0
問題只是希望GUI看起來像這樣:無法Java GUI以我想要的方式...?
下面的代碼我有
import javax.swing.JOptionPane;
class Customer
{
String n = JOptionPane.showInputDialog("Enter name");
String id = JOptionPane.showInputDialog("Enter id");
String sub = JOptionPane.showInputDialog("Enter Submit");
JOptionPane.showMessageDialog(null, null, null, JOptionPane.PLAIN_MESSAGE)
}
}
我想這一切看起來水平
Enter Name [box to fill in name]
Enter id [box to fill in id]
Submit [box to enter submit]
開始用一些輕閱讀:[創建GUI用JFC/Swing的(http://docs.oracle.com/javase/tutorial/uiswing/ ),[在容器中放置組件](http://docs.oracle.com/javase/tutorial/uiswing/layout/index.html),[如何使用文本字段](http://docs.oracle.com)。 (如何使用按鈕,複選框和單選按鈕)(http://docs.oracle.com/javase/tutorial/uiswing/components/button.html ),你可能會想[如何編寫一個動作監聽器](http://docs.oracle.com/javase/tutorial/uiswing/events/actionlistener.html) – MadProgrammer 2015-03-25 01:41:23
嘿謝謝你的鏈接,真的幫了大忙! – Noah 2015-03-26 01:59:39
不用擔心,玩得開心;) – MadProgrammer 2015-03-26 02:00:19