import java.awt.EventQueue;
import java.util.Scanner;
import javax.swing.JFrame;
import javax.swing.JTextField;
import java.awt.BorderLayout;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class TESTING {
private JFrame frame;
private JTextField txtFeld1;
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
TESTING window = new TESTING();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
public TESTING() {
initialize();
}
private void initialize() {
frame = new JFrame();
frame.setBounds(100, 100, 450, 300);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);
txtFeld1 = new JTextField();
txtFeld1.setBounds(99, 0, 335, 262);
frame.getContentPane().add(txtFeld1);
txtFeld1.setColumns(10);
JButton btn1 = new JButton("Auslesen");
btn1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
Scanner sc = new Scanner(System.in);
if(sc.equals(null)){
//dieser teil dient nur der überprüfung auf richtigkeit
System.out.println("Hat funktioniert");
}
}
});
btn1.setBounds(0, 0, 89, 262);
frame.getContentPane().add(btn1);
}
}