20150327 文字方塊及按鈕
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");
JTextField jtfInput = new JTextField(20);
JPanel jpPanel = new JPanel();
JButton jbnButton1= new JButton("Button 1");
JButton jbnButton2= new JButton("Button 2");
jpPanel.add(jbnButton1);
jpPanel.add(jbnButton2);
jpPanel.add(jtfInput);
jtfMainFrame.setSize(300, 200);
jtfMainFrame.getContentPane().add(jpPanel, BorderLayout.CENTER);
jtfMainFrame.setVisible(true);
System.out.println("abc");
}
}
0 個意見:
張貼留言
訂閱 張貼留言 [Atom]
<< 首頁