import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class Test {
public static void main(String args[])
{
JFrame jtfMainFrame = new JFrame("Which Button Demo");
jtfMainFrame.setSize(150, 150);
JButton jbnButton1 = new JButton("Button 1");
JButton jbnButton2 = new JButton("Button 2");
JPanel jplPanel = new JPanel();
JTextField jtfInput = new JTextField(20);
jplPanel.add(jbnButton1);
jplPanel.add(jbnButton2);
jplPanel.add(jtfInput);
jtfMainFrame.getContentPane().add(jplPanel, BorderLayout.CENTER);
jtfMainFrame.setVisible(true);
System.out.print("hi");
}
}
沒有留言:
張貼留言