我是Java Swing的新手,我有一個我想要修改的代碼。我只想添加另一個按鈕;它的顯示方式如下code 1
,但在運行時它不顯示。 code1
這是我想要添加到code 2
的代碼。JLabel實例未顯示
碼1
JLabel process = new JLabel ("process:");
final JTextField Tprocess = new JTextField ("Process", 40);
final JButton btn_ProcessFile = new JButton ("ProcessFile");
代碼2
JLabel Ldatei = new JLabel ("Datei auswählen:");
final JTextField Tdatei = new JTextField ("", 20);
final JButton Bsearch = new JButton ("Datei wählen");
顯示出代碼中使用定義的對象。 – 2014-12-09 11:37:50
考慮提供一個[可運行的示例](https://stackoverflow.com/help/mcve),它演示了您的問題。這將減少混淆和更好的反應 – MadProgrammer 2014-12-09 11:47:17
請學習常用的Java命名規則(命名約定 - 例如'EachWordUpperCaseClass','firstWordLowerCaseMethod()','firstWordLowerCaseAttribute',除非它是'CONSTANT')並且一致地使用它。 – 2014-12-09 23:47:26