package frame;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
/**
*
Title: frame</p>
*
Description: frame</p>
*
Copyright: Copyright (c) 2004</p>
*
Company: </p>
* @author baer
* @version 1.0
*/
public class Dialog1 extends JDialog {
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
JTextField jTextField1 = new JTextField();
JTextField jTextField2 = new JTextField();
JTextField jTextField3 = new JTextField();
String ende;
ActionWaechterC aktionen = new ActionWaechterC();
public Dialog1(Frame frame, String title, boolean modal) {
super(frame, title, modal);
try {
jbInit();
pack();
}
catch(Exception ex) {
ex.printStackTrace();
}
}
public Dialog1() {
this(null, "", false);
}
public Dialog1(JFrame parent) {
super(parent, "dialog", true);
try {
jbInit();
pack();
}
catch(Exception ex) {
ex.printStackTrace();
}
}
private void jbInit() throws Exception {
jButton1.setBounds(new Rectangle(31, 166, 91, 19));
jButton1.setText("OK");
this.setTitle("dialog");
this.getContentPane().setLayout(null);
jButton2.setBounds(new Rectangle(139, 166, 88, 19));
jButton2.setText("Cancel");
jButton2.addActionListener(new Dialog1_jButton2_actionAdapter(this));
jTextField1.setText("");
jTextField1.setBounds(new Rectangle(95, 32, 91, 17));
jTextField2.setText("");
jTextField2.setBounds(new Rectangle(95, 62, 93, 17));
jTextField3.setText("");
jTextField3.setBounds(new Rectangle(94, 90, 94, 20));
this.getContentPane().add(jButton1, null);
this.getContentPane().add(jButton2, null);
this.getContentPane().add(jTextField1, null);
this.getContentPane().add(jTextField2, null);
this.getContentPane().add(jTextField3, null);
jButton1.addActionListener(aktionen);
jButton2.addActionListener(aktionen);
setVisible(true);
}
class ActionWaechterC implements ActionListener {
public void actionPerformed(ActionEvent e) {
Object source = e.getSource();
if(source == jButton1) {
ende = "OK";
setVisible(false);
}else {
ende = "Cancel";
setVisible(false);
}
}
}
public String getEnde() {
return ende;
}
public String getJTextField1() {
return jTextField1.getText();
}
public String getJTextField2() {
return jTextField2.getText();
}
public String getJTextField3() {
return jTextField3.getText();
}
void jButton2_actionPerformed(ActionEvent e) {
}
}
class Dialog1_jButton2_actionAdapter implements java.awt.event.ActionListener {
Dialog1 adaptee;
Dialog1_jButton2_actionAdapter(Dialog1 adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton2_actionPerformed(e);
}
}