Package Frame

Source Code of Frame.JPanelKlasse

package Frame;

import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JComboBox;

import javax.swing.WindowConstants;
import javax.swing.border.TitledBorder;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class JPanelKlasse extends javax.swing.JPanel {

  {
    //Set Look & Feel
    try {
      javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
    } catch(Exception e) {
      e.printStackTrace();
    }
  }

  private JLabel jLabelJahrgang;
  private JTextField jTextFieldJahrgang;
  private JPanel jPanelLehrer;
  private JTextField jTextFieldName;
  private JTextField jTextFieldVName;
  private JButton jButtonAbbrechen;
  private JButton jButtonAnlegen;
  private ButtonGroup buttonGroupGeschlecht;
  private JRadioButton jRadioButtonWeiblich;
  private JRadioButton jRadioButtonMaennlich;
  private JLabel jLabelVName;
  private JLabel jLabelName;
  private JComboBox jComboBoxBildungsgang;
  private JFrameMain jFrameMain;

  /**
   * Auto-generated main method to display this
   * JPanel inside a new JFrame.
   */
  public static void main(String[] args) {
    JFrame frame = new JFrame();
    frame.getContentPane().add(new JPanelKlasse());
    frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    frame.pack();
    frame.setVisible(true);
  }

  public JPanelKlasse() {
    super();
    initGUI();
  }

  private void initGUI() {
    try {
      this.setPreferredSize(new java.awt.Dimension(407, 137));
      this.setLayout(null);
      this.setBorder(BorderFactory.createTitledBorder("Klasse anlegen"));
      {
        jLabelJahrgang = new JLabel();
        this.add(jLabelJahrgang);
        jLabelJahrgang.setText("Jahrgang:");
        jLabelJahrgang.setBounds(145, 28, 69, 15);
      }
      {
        ComboBoxModel jComboBoxBildungsgangModel =
          new DefaultComboBoxModel(
              new String[] { "DQMata", "Mata"});
        jComboBoxBildungsgang = new JComboBox();
        this.add(jComboBoxBildungsgang);
        jComboBoxBildungsgang.setModel(jComboBoxBildungsgangModel);
        jComboBoxBildungsgang.setBounds(12, 24, 121, 22);
      }
      {
        jTextFieldJahrgang = new JTextField();
        this.add(jTextFieldJahrgang);
        jTextFieldJahrgang.setBounds(224, 25, 51, 22);
      }
      {
        jPanelLehrer = new JPanel();
        this.add(jPanelLehrer);
        jPanelLehrer.setBounds(12, 47, 267, 83);
        jPanelLehrer.setBorder(BorderFactory.createTitledBorder(null, "Klassrenlehrer", TitledBorder.LEFT, TitledBorder.TOP));
        jPanelLehrer.setLayout(null);
        {
          jLabelName = new JLabel();
          jPanelLehrer.add(jLabelName);
          jLabelName.setText("Name:");
          jLabelName.setBounds(12, 29, 56, 15);
        }
        {
          jTextFieldName = new JTextField();
          jPanelLehrer.add(jTextFieldName);
          jTextFieldName.setBounds(75, 26, 69, 22);
        }
        {
          jLabelVName = new JLabel();
          jPanelLehrer.add(jLabelVName);
          jLabelVName.setText("Vorname: ");
          jLabelVName.setBounds(12, 55, 63, 15);
        }
        {
          jTextFieldVName = new JTextField();
          jPanelLehrer.add(jTextFieldVName);
          jTextFieldVName.setBounds(75, 52, 69, 22);
        }
        {
          jRadioButtonMaennlich = new JRadioButton();
          jPanelLehrer.add(jRadioButtonMaennlich);
          jRadioButtonMaennlich.setText("maennlich");
          jRadioButtonMaennlich.setBounds(156, 28, 86, 21);
          getButtonGroupGeschlecht().add(jRadioButtonMaennlich);
        }
        {
          jRadioButtonWeiblich = new JRadioButton();
          jPanelLehrer.add(jRadioButtonWeiblich);
          jRadioButtonWeiblich.setText("weiblich");
          jRadioButtonWeiblich.setBounds(156, 53, 75, 19);
          getButtonGroupGeschlecht().add(jRadioButtonWeiblich);
        }
      }
      {
        jButtonAnlegen = new JButton();
        this.add(jButtonAnlegen);
        jButtonAnlegen.setText("Anlegen");
        jButtonAnlegen.setBounds(285, 63, 90, 32);
      }
      {
        jButtonAbbrechen = new JButton();
        this.add(jButtonAbbrechen);
        jButtonAbbrechen.setText("Abbrechen");
        jButtonAbbrechen.setBounds(285, 95, 90, 32);
        jButtonAbbrechen.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            jButtonAbbrechenActionPerformed(evt);
          }
        });
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

  private ButtonGroup getButtonGroupGeschlecht() {
    if(buttonGroupGeschlecht == null) {
      buttonGroupGeschlecht = new ButtonGroup();
    }
    return buttonGroupGeschlecht;
  }

  public void myInitGui(JFrameMain myJFrameMain)
  {
    jFrameMain = myJFrameMain;
  }

  private void jButtonAbbrechenActionPerformed(ActionEvent evt)
  {
    jFrameMain.bildungsgang();
  }

}
TOP

Related Classes of Frame.JPanelKlasse

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.