julian.veh
Bekanntes Mitglied
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
Entspricht zwar nicht haargenau deinen Anforderungen, aber wenigstens konnte ich mal antworten statt zu fragen ^^
lG
import java.awt.event.ActionListener;
import javax.swing.*;
Java:
public class Blabla
{
public static void main (String[] args)
{
JFrame frame1 = new JFrame("Test");
frame1.setSize(800,600);
frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
final JTextField tf1 = new JTextField("Hier eingeben");
JButton button1 = new JButton("übernehmen");
final JLabel label1 = new JLabel("Ihre Eingabe");
button1.addActionListener(new ActionListener() { @Override
public void actionPerformed(ActionEvent action)
{
String a = tf1.getText();
label1.setText("" + a);
}
});
Box container1 = new Box(BoxLayout.Y_AXIS);
Box container2 = new Box(BoxLayout.X_AXIS);
Box container3 = new Box(BoxLayout.X_AXIS);
Box container4 = new Box(BoxLayout.X_AXIS);
container2.add(label1);
container3.add(tf1);
container4.add(button1);
container1.add(container2);
container1.add(container3);
container1.add(container4);
frame1.add(container1);
frame1.setVisible(true);
}
}
Entspricht zwar nicht haargenau deinen Anforderungen, aber wenigstens konnte ich mal antworten statt zu fragen ^^
lG