summaryrefslogtreecommitdiffstats
path: root/Dozentenmodul/src/gui/intro/About_GUI.java
blob: 447f18ee69a18cd77fb2e34f7328e6aa7802f7d2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package gui.intro;

import java.awt.Image;
import java.awt.SystemColor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextPane;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.border.EmptyBorder;

import util.GuiOrganizer;

@SuppressWarnings("serial")
public class About_GUI extends JFrame {

	private JPanel contentPane;
	private JTextPane txtpnVersionVBuilddate;

	/**
	 * Create the frame.
	 */
	public About_GUI() {
		// Fenster darf nicht vergroessert werden
		setResizable(false);

		try {
			// Setzt das Look and Feel auf System
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (ClassNotFoundException | InstantiationException
				| IllegalAccessException | UnsupportedLookAndFeelException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			JOptionPane.showMessageDialog(null,
					e.getCause() + "\n" + e.getMessage(), "Debug-Message",
					JOptionPane.ERROR_MESSAGE);
		}
		// Titel des Fensters setzen
		setTitle("Dozentenmodul *Prototyp* - About");
		// Aktion die beim Schliessen durchgefuehrt werden soll
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		// Groesse des Fensters definieren
		setBounds(0, 0, 355, 309);
		GuiOrganizer.centerGUI(this);
		// Erzeugen eines Panels
		contentPane = new JPanel();
		// Hintergrund Farbe des Panels setzen
		contentPane.setBackground(SystemColor.menu);
		// Rahmen des Fensters setzen
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		// Layout setzen
		contentPane.setLayout(null);
		// Label fuer das Logo erzeugen
		JLabel imgLabel = new JLabel();
		// Groesse und Position des Logos festelegen
		imgLabel.setBounds(30, 18, 294, 80);
		// Pfadangabe des Logos

		ImageIcon icon = new ImageIcon(getClass().getResource(
				"/Logo_bwLehrpool.png"), "Logo");
		// Skalierung des Logos
		Image scaled = icon.getImage().getScaledInstance(270, 64, 0);
		imgLabel.setIcon(new ImageIcon(scaled));
		// Hinzufuegen des Logos in das Fenster
		contentPane.add(imgLabel);

		// Erzeugen, Hinzufuegen und definierung der Aktion des Buttons
		JButton BtnClose = new JButton("Close");
		BtnClose.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				dispose();

			}// end actionPerformed
		});

		BtnClose.setBounds(62, 226, 237, 23);
		contentPane.add(BtnClose);

		txtpnVersionVBuilddate = new JTextPane();
		txtpnVersionVBuilddate
				.setText("Version: v0.1\r\nBuild-Date: 03.06.2014\r\n\r\nContact: michael.wilson@hs-offenburg.de\r\nWebsite: http://bwlehrpool.hs-offenburg.de/");
		txtpnVersionVBuilddate.setEditable(false);
		txtpnVersionVBuilddate.setBackground(SystemColor.menu);
		txtpnVersionVBuilddate.setBounds(62, 95, 224, 90);
		contentPane.add(txtpnVersionVBuilddate);
	}// end LoginGUI()
}// end class