package demo;
/**
* Main window
* @author Andreas Dvorak
*/
import java.awt.*;
import javax.swing.*;
public class MainFrame {
public boolean status = true;
private JFrame frame = null;
public MainFrame() {
initFrame();
}
public void initFrame() {
frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(600, 620);
frame.setTitle("Bestenliste");
// In der Mitte des Bildschirms platzieren
frame.setLocation(
(Toolkit.getDefaultToolkit().getScreenSize().width -
frame.getSize().width) / 2,
(Toolkit.getDefaultToolkit().getScreenSize().height -
frame.getSize().height) / 2);
StartPanel panel = new StartPanel();
frame.setContentPane(panel.getPanel());
frame.setVisible(true);
}
public static void main(final String[] args) {
//DU MUSST DAS DING MIT "invokeLater" STARTEN !!!
// java.awt.EventQueue.invokeLater(new Runnable() {
//
// public void run() {
new MainFrame();
// }
// });
}
}
class StartPanel {
private String version = "1.0";
public JPanel getPanel() {
JPanel panel = new JPanel();
JPanel uppanel = new JPanel();
uppanel.setBackground(new java.awt.Color(238, 238, 238));
JPanel midpanel = new JPanel();
midpanel.setBackground(new java.awt.Color(238, 238, 238));
JPanel downpanel = new JPanel();
downpanel.setBackground(new java.awt.Color(238, 238, 238));
JPanel statuspanel = new JPanel();
statuspanel.setBackground(new java.awt.Color(238, 238, 238));
JTextPane text1 = new JTextPane();
text1.setBackground(new java.awt.Color(238, 238, 238));
JTextPane text2 = new JTextPane();
text2.setBackground(new java.awt.Color(238, 238, 238));
JTextPane text3 = new JTextPane();
text3.setBackground(new java.awt.Color(238, 238, 238));
JTextPane statustext = new JTextPane();
statustext.setBackground(new java.awt.Color(238, 238, 238));
GridLayout gridLayout = new GridLayout();
gridLayout.setRows(4);
gridLayout.setColumns(1);
panel.setLayout(gridLayout);
FlowLayout flowLayout = new FlowLayout();
flowLayout.setHgap(20);
flowLayout.setVgap(40);
uppanel.setLayout(flowLayout);
panel.add(uppanel);
panel.add(midpanel);
panel.add(downpanel);
panel.add(statuspanel);
text1.setText("Bestenliste für die Verwaltung von Laufergebnissen");
text1.setFont(new java.awt.Font("Arial", java.awt.Font.BOLD, 18));
text1.setEditable(false);
text2.setText("Andreas Dvorak");
text2.setFont(new java.awt.Font("Arial", java.awt.Font.BOLD, 18));
text2.setEditable(false);
text3.setText("Version " + version);
text3.setFont(new java.awt.Font("Arial", java.awt.Font.BOLD, 18));
text3.setEditable(false);
statustext.setText("Status: registriert");
statustext.setFont(new java.awt.Font("Arial", java.awt.Font.BOLD, 14));
statustext.setEditable(false);
uppanel.add(text1);
midpanel.add(text2);
downpanel.add(text3);
statuspanel.add(statustext);
return panel;
}
}