import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.net.*;
import java.sql.*;
public class Befehl extends JFrame implements ActionListener {
JButton bu1, bu2;
public Befehl(){
super("Suche nach Datensätzen");
JPanel pane = new JPanel();
pane.setLayout(new GridBagLayout());
JLabel labe = new JLabel();
labe.setOpaque(true);
labe.setFont(new Font("Helvetica", Font.BOLD, 20));
labe.setText("Datensatz - Suche");
pane.add(labe, new GridBagConstraints(0,0,1,1,1.0,0.1,
GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0,0,0,0),1,1));
JLabel labe2 = new JLabel();
labe2.setOpaque(true);
labe2.setFont(new Font("Helvetica", Font.BOLD,14));
labe2.setText("zu durchsuchende Datenbank: ");
pane.add(labe2, new GridBagConstraints(0,1,1,1,1.0,0.1,
GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0,0,0,0), 1,1));
JLabel labe3 = new JLabel();
labe3.setOpaque(true);
labe3.setFont(new Font("Helvetica", Font.BOLD,14));
labe3.setText("Suchbegriff: ");
pane.add(labe3, new GridBagConstraints(0,2,1,1,1.0,0.1,
GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0,0,0,0), 1,1));
JTextArea ausg = new JTextArea();
ausg.setFont(new Font("Helvetica", Font.PLAIN, 14));
ausg.setEditable(false);
JScrollPane scro = new JScrollPane(ausg);
pane.add(scro, new GridBagConstraints(3,1,6,3,1.0,0.1,
GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0,0,0,0),1,1));
JTextField tf1 = new JTextField();
tf1.setFont(new Font("Helvetica", Font.PLAIN, 14));
pane.add(tf1, new GridBagConstraints(1,1,1,1,1.0,0.1,
GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0,0,0,0),1,1));
JTextField tf2 = new JTextField();
tf2.setFont(new Font("Helvetica", Font.PLAIN, 14));
pane.add(tf2, new GridBagConstraints(1,2,1,1,1.0,0.1,
GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0,0,0,0),1,1));
bu1 = new JButton();
bu1.setText("Suchen");
bu1.setBackground(Color.green);
bu1.addActionListener(this);
pane.add(bu1, new GridBagConstraints(0,3,1,1,1.0,0.1,
GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0,0,0,0),1,1));
bu2 = new JButton();
bu2.setText("Schließen");
bu2.setBackground(Color.red);
bu2.addActionListener(this);
pane.add(bu2, new GridBagConstraints(1,3,1,1,1.0,0.1,
GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0,0,0,0),1,1));
this.getContentPane().setLayout(new GridBagLayout());
this.getContentPane().add(pane, new GridBagConstraints(0,0,1,1,1.0,1.0,
GridBagConstraints.NORTH, GridBagConstraints.BOTH, new Insets(0,0,0,0),1,1));
this.pack();
this.setVisible(true);
}
public void actionPerformed(ActionEvent e){
Object obj = e.getSource();
if(obj == bu1){
}
if(obj == bu2) {
this.dispose();
}
}
public static void main(String[] args) {
new Befehl();
}
}