中找不到,我知道這個主題已經被破壞了幾次,但是我在修復它的時候遇到了一個錯誤,這個錯誤被認爲是在其他錯誤中修復的。Java-主要方法在
public static class FlowAp extends JFrame{
String one = "One";
String two = "Two";
String three = "Three";
String four = "Four";
String five = "Five";
public static void main(String argv[]){
FlowAp fa=new FlowAp();
//Change from BorderLayout default
fa.getContentPane().setLayout(new FlowLayout());
fa.setSize(200,200);
fa.setVisible(true);
}
FlowAp(){
JButton one = new JButton("One");
getContentPane().add(one);
JButton two = new JButton("Two");
getContentPane().add(two);
JButton three = new JButton("Three");
getContentPane().add(three);
JButton four = new JButton("four");
getContentPane().add(four);
JButton five = new JButton("five");
getContentPane().add(five);
}
}
當我居然把括號,他們看起來好像他們是應該的,另一個錯誤顯示了與flowap「無效的方法聲明」
*其中*是無效的方法聲明,完全是?這是另一個嵌套類嗎?請給*所有*你看到的錯誤的細節。 –
你如何嘗試啓動程序? – ShiDoiSi
問題標題似乎不匹配身體。 –