public class Output extends JFrame implements ActionListener, ComponentListener {
private static final long serialVersionUID = 1L;
public static String options[] = {"A60", "A61" }; // usw. Hier kommen noch ca 70 weitere Optionen
public static int test;
public boolean option_zaehler = false;
public static JPanel jOptionPanel = null;
public static JPanel jPanel = null;
private JLabel lb_Head = null;
private JLabel lb_Prgnr = null;
private JLabel lb_Customer = null;
// usw.
public static JTextField tf_PrgNr = null;
public static JTextField tf_Customer = null;
// usw.
public static JButton bt_Erstellen = null;
public static JButton bt_Beenden = null;
public static JCheckBox cb_A60 = null;
public static JCheckBox cb_A61 = null;
// usw.
private JLabel lb_A60 = null;
private JLabel lb_A61 = null;
// usw.
private JButton bt_aendern_optionen = null;
private JLabel lb_revision2 = null;
/**
* This is the default constructor
*/
public Output() {
this.getJPanel();
initialize();
}
/**
* This method initializes this
*
* @return void
*/
public void initialize() {
this.setSize(894, 785);
this.setContentPane(getJPanel());
this.setTitle("SOP Generator");
Menubar m = new Menubar();
this.setJMenuBar(m);
}
/**
* This method initializes jPanel
*
* @return javax.swing.JPanel
*/
private JPanel getJPanel() {
if (jPanel == null) {
lb_revision2 = new JLabel();
lb_revision2.setBounds(new Rectangle(751, 261, 124, 25));
lb_revision2.setFont(new Font("Dialog", Font.BOLD, 8));
lb_revision2.setText("Hier nur Änderungen eintragen");
lb_Customer = new JLabel();
lb_Customer.setName("Customer");
lb_Customer.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
lb_Customer.setLocation(new Point(38, 110));
lb_Customer.setSize(new Dimension(80, 25));
lb_Customer.setText("Customer");
lb_Prgnr = new JLabel();
lb_Prgnr.setName("Program Number");
lb_Prgnr.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
lb_Prgnr.setLocation(new Point(11, 80));
lb_Prgnr.setSize(new Dimension(107, 25));
lb_Prgnr.setText("Program Number");
lb_Head = new JLabel();
lb_Head.setText("Bla");
lb_Head.setSize(new Dimension(692, 50));
lb_Head.setName("Bla");
lb_Head.setHorizontalTextPosition(SwingConstants.CENTER);
lb_Head.setFont(new Font("Arial", 0, 18));
lb_Head.setLocation(new Point(121, 6));
jPanel = new JPanel();
jPanel.setLayout(null);
jPanel.add(lb_Head, null);
jPanel.add(lb_Prgnr, null);
jPanel.add(lb_Customer, null);
jPanel.add(getJOptionPanel(), null);
jPanel.add(getBt_aendern_optionen(), null);
jPanel.add(lb_revision2, null);
}
return jPanel;
}
/**
* This method initializes tf_Pprivate *
* @return javax.swing.JTextField
*/
private JTextField getTf_PrgNr() {
if (tf_PrgNr == null) {
tf_PrgNr = new JTextField();
tf_PrgNr.setLocation(new Point(150, 80));
tf_PrgNr.setSize(new Dimension(600, 25));
}
return tf_PrgNr;
}
/**
* This method initializes tf_Custprivate *
* @return javax.swing.JTextField
*/
private JTextField getTf_Customer() {
if (tf_Customer == null) {
tf_Customer = new JTextField();
tf_Customer.setLocation(new Point(150, 110));
tf_Customer.setSize(new Dimension(600, 25));
}
return tf_Customer;
}
/**
* This method initializes jOptionPanel
*
* @return javax.swing.JPanel
*/
private JPanel getJOptionPanel() {
if (jOptionPanel == null) {
lb_A61 = new JLabel();
lb_A61.setBounds(new Rectangle(90, 5, 30, 20));
lb_A61.setToolTipText("bla2");
lb_A61.setText("A61");
lb_A60 = new JLabel();
lb_A60.setBounds(new Rectangle(30, 5, 30, 20));
lb_A60.setToolTipText("bla1");
lb_A60.setText("A60");
// usw.
jOptionPanel = new JPanel();
jOptionPanel.setLayout(null);
jOptionPanel.setBounds(new Rectangle(149, 378, 714, 269));
Color newcolor = new Color(53, 71, 249, 5); // r, b, g, alpha
jOptionPanel.setBackground(newcolor);
jOptionPanel.add(getCb_A60(), null);
jOptionPanel.add(lb_A60, null);
jOptionPanel.add(getCb_A61(), null);
jOptionPanel.add(lb_A61, null);
// usw.
jOptionPanel.setVisible(false);
}
return jOptionPanel;
}
/**
* This method initializes cb_A60
*
* @return javax.swing.JCheckBox
*/
private JCheckBox getCb_A60() {
if (cb_A60 == null) {
cb_A60 = new JCheckBox();
cb_A60.setBounds(new Rectangle(10, 5, 20, 20));
cb_A60.setToolTipText("bla");
}
return cb_A60;
}
/**
* This method initializes cb_A61
*
* @return javax.swing.JCheckBox
*/
private JCheckBox getCb_A61() {
if (cb_A61 == null) {
cb_A61 = new JCheckBox();
cb_A61.setBounds(new Rectangle(70, 5, 20, 20));
cb_A61.setToolTipText("bla");
}
return cb_A61;
}
/**
* This method initializes bt_aendern_optionen
*
* @return javax.swing.JButton
*/
private JButton getBt_aendern_optionen() {
if (bt_aendern_optionen == null) {
bt_aendern_optionen = new JButton("Aendern Optionen");
bt_aendern_optionen.setBounds(new Rectangle(489, 310, 150, 35));
bt_aendern_optionen.setVisible(false);
bt_aendern_optionen.setActionCommand("bt_aendern_optionen");
bt_aendern_optionen.addActionListener(this);
}
return bt_aendern_optionen;
}
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
if ("SOP erstellen".equals(e.getActionCommand())){
Aktionen.erstellen();
}
if ("Beenden".equals(e.getActionCommand())){
Aktionen.beenden(); }
//Option Button
if ("bt_option".equals(e.getActionCommand())){
if(option_zaehler == false){
// bt_option.setIcon(new ImageIcon("http://www.tutorials.de/forum/images/bt_close.png"));
jOptionPanel.setVisible(true);
// lb_Options_Info.setVisible(true);
option_zaehler = true;
bt_aendern_optionen.setVisible(true);
}else{
// bt_option.setIcon(new ImageIcon("http://www.tutorials.de/forum/images/bt_open.png"));
jOptionPanel.setVisible(false);
// lb_Options_Info.setVisible(false);
option_zaehler = false;
bt_aendern_optionen.setVisible(false);
}
}
if("bt_aendern_optionen".equals(e.getActionCommand())){
OptionChange.dlm.clear();
Aktionen.auslesen_options();
OptionChange optch1 = new OptionChange();
}
}
public void componentHidden(ComponentEvent arg0) {
// TODO Auto-generated method stub
}
public void componentMoved(ComponentEvent arg0) {
// TODO Auto-generated method stub
}
public void componentResized(ComponentEvent arg0) {
// TODO Auto-generated method stub
}
public void componentShown(ComponentEvent c) {
// TODO Auto-generated method stub
}
}