Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Font;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import javax.swing.GroupLayout;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JMenu;
- import javax.swing.JMenuBar;
- import javax.swing.JMenuItem;
- import javax.swing.JOptionPane;
- import javax.swing.JPanel;
- import javax.swing.JTextField;
- import javax.swing.LayoutStyle;
- public class wochenplanGUI extends JFrame {
- wochenplan main = new wochenplan();
- configMitarbeiter configMA = new configMitarbeiter();
- double version = main.version;
- double versionMAEditor = main.versionMAEditor;
- public void mainGUI() {
- JLabel userLabel1 = new JLabel(configMA.getMitarbeiter(configMA.user1));
- JLabel userLabel2 = new JLabel(configMA.getMitarbeiter(configMA.user2));
- JLabel userLabel3 = new JLabel(configMA.getMitarbeiter(configMA.user3));
- JLabel userLabel4 = new JLabel(configMA.getMitarbeiter(configMA.user4));
- JLabel userLabel5 = new JLabel(configMA.getMitarbeiter(configMA.user5));
- JLabel userLabel6 = new JLabel(configMA.getMitarbeiter(configMA.user6));
- JLabel userLabel7 = new JLabel(configMA.getMitarbeiter(configMA.user7));
- JLabel userLabel8 = new JLabel(configMA.getMitarbeiter(configMA.user8));
- JLabel userLabel9 = new JLabel(configMA.getMitarbeiter(configMA.user9));
- JLabel userLabel10 = new JLabel(configMA.getMitarbeiter(configMA.user10));
- JLabel userLabel11 = new JLabel(configMA.getMitarbeiter(configMA.user11));
- JLabel userLabel12 = new JLabel(configMA.getMitarbeiter(configMA.user12));
- JLabel Montag = new JLabel();
- JLabel Dienstag = new JLabel();
- JLabel Mittwoch = new JLabel();
- JLabel Donnerstag = new JLabel();
- JLabel Freitag = new JLabel();
- JLabel Samstag = new JLabel();
- JLabel vormittagMontag = new JLabel();
- vormittagMontag.setFont(new Font("Tahoma", 1, 12));
- vormittagMontag.setText("Vormittag");
- JLabel nachmittagMontag = new JLabel();
- nachmittagMontag.setFont(new Font("Tahoma", 1, 12));
- nachmittagMontag.setText("Nachmittag");
- JLabel vormittagVon = new JLabel("von");
- JLabel vormittagBis = new JLabel("bis");
- JLabel nachmittagVon = new JLabel("von");
- JLabel nachmittagBis = new JLabel("bis");
- //TextFields
- JTextField vormittagVonTextUser1 = new JTextField();
- JTextField vormittagVonTextUser2 = new JTextField();
- JTextField vormittagVonTextUser3 = new JTextField();
- JTextField vormittagVonTextUser4 = new JTextField();
- JTextField vormittagVonTextUser5 = new JTextField();
- JTextField vormittagVonTextUser6 = new JTextField();
- JTextField vormittagVonTextUser7 = new JTextField();
- JTextField vormittagVonTextUser8 = new JTextField();
- JTextField vormittagVonTextUser9 = new JTextField();
- JTextField vormittagVonTextUser10 = new JTextField();
- JTextField vormittagVonTextUser11 = new JTextField();
- JTextField vormittagVonTextUser12 = new JTextField();
- JTextField vormittagBisTextUser1 = new JTextField();
- JTextField vormittagBisTextUser2 = new JTextField();
- JTextField vormittagBisTextUser3 = new JTextField();
- JTextField vormittagBisTextUser4 = new JTextField();
- JTextField vormittagBisTextUser5 = new JTextField();
- JTextField vormittagBisTextUser6 = new JTextField();
- JTextField vormittagBisTextUser7 = new JTextField();
- JTextField vormittagBisTextUser8 = new JTextField();
- JTextField vormittagBisTextUser9 = new JTextField();
- JTextField vormittagBisTextUser10 = new JTextField();
- JTextField vormittagBisTextUser11 = new JTextField();
- JTextField vormittagBisTextUser12 = new JTextField();
- JTextField nachmittagVonTextUser1 = new JTextField();
- JTextField nachmittagVonTextUser2 = new JTextField();
- JTextField nachmittagVonTextUser3 = new JTextField();
- JTextField nachmittagVonTextUser4 = new JTextField();
- JTextField nachmittagVonTextUser5 = new JTextField();
- JTextField nachmittagVonTextUser6 = new JTextField();
- JTextField nachmittagVonTextUser7 = new JTextField();
- JTextField nachmittagVonTextUser8 = new JTextField();
- JTextField nachmittagVonTextUser9 = new JTextField();
- JTextField nachmittagVonTextUser10 = new JTextField();
- JTextField nachmittagVonTextUser11 = new JTextField();
- JTextField nachmittagVonTextUser12 = new JTextField();
- JTextField nachmittagBisTextUser1 = new JTextField();
- JTextField nachmittagBisTextUser2 = new JTextField();
- JTextField nachmittagBisTextUser3 = new JTextField();
- JTextField nachmittagBisTextUser4 = new JTextField();
- JTextField nachmittagBisTextUser5 = new JTextField();
- JTextField nachmittagBisTextUser6 = new JTextField();
- JTextField nachmittagBisTextUser7 = new JTextField();
- JTextField nachmittagBisTextUser8 = new JTextField();
- JTextField nachmittagBisTextUser9 = new JTextField();
- JTextField nachmittagBisTextUser10 = new JTextField();
- JTextField nachmittagBisTextUser11 = new JTextField();
- JTextField nachmittagBisTextUser12 = new JTextField();
- //JPanels
- JPanel panelMontag = new JPanel();
- //Diverses
- setDefaultCloseOperation(EXIT_ON_CLOSE);
- setVisible(true);
- setSize(306, 399);
- //GUIBauen
- // MENÜ ###############################################################################################################
- JMenuBar menuBar = new JMenuBar();
- setJMenuBar(menuBar);
- JMenu datei = new JMenu("Datei");
- JMenu hilfe = new JMenu("Hilfe");
- menuBar.add(datei);
- menuBar.add(hilfe);
- JMenuItem drucken = new JMenuItem("Drucken");
- datei.add(drucken);
- drucken.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent event) {
- wochenplanDrucken.druckObjekt(getRootPane());
- }
- });
- datei.addSeparator();
- JMenuItem mitarbeiterEditorBeenden = new JMenuItem("Editor beenden");
- datei.add(mitarbeiterEditorBeenden);
- mitarbeiterEditorBeenden.addActionListener(new ActionListener(){
- public void actionPerformed(ActionEvent event) {
- dispose();
- }
- });
- JMenuItem hilfeItem = new JMenuItem("Hilfe");
- hilfe.add(hilfeItem);
- hilfeItem.addActionListener(new ActionListener(){
- public void actionPerformed(ActionEvent event) {
- JOptionPane.showMessageDialog(null, "AAAAAAAAAAAAAAAAAAAAAAAAAAHHHH!!!!", "Hilfe!", JOptionPane.PLAIN_MESSAGE);
- }
- });
- JMenuItem über = new JMenuItem("Über dieses Programm");
- hilfe.add(über);
- über.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- JOptionPane.showMessageDialog(null, "Dieses Programm berechnet den aktuellen Wochenplan\nVersionsnummer Wochenplan: " + version + "\nVersionsnummer MitarbeiterEditor: " + versionMAEditor, "Über dieses Programm", JOptionPane.PLAIN_MESSAGE);
- }
- });
- // MENÜ ENDE ###############################################################################################################
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement