Y
yby
Unregistered / Unconfirmed
GUEST, unregistred user!
import java.io.*;
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.border.*;
import javax.swing.table.*;
class createGUI extends JFrame implements Runnable {
public createGUI() {
setTitle("個人財物管理");
setSize(600,400);
setResizable(false);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
setLocation(100,100);
}
incomePanel.setLayout(new GridLayout(3,2,10,40));
incomePanel.add(incomeRecordButton);
private Font f=new Font("SansSerif",Font.BOLD,16);
private JPanel incomePanel=new JPanel();
private JButton incomeRecordButton=new IncomeRecordButton("中央控制器",f);
}
錯誤提示:incomeRecordButton 變量無效
請問這是甚麼原因,謝謝!
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.border.*;
import javax.swing.table.*;
class createGUI extends JFrame implements Runnable {
public createGUI() {
setTitle("個人財物管理");
setSize(600,400);
setResizable(false);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
setLocation(100,100);
}
incomePanel.setLayout(new GridLayout(3,2,10,40));
incomePanel.add(incomeRecordButton);
private Font f=new Font("SansSerif",Font.BOLD,16);
private JPanel incomePanel=new JPanel();
private JButton incomeRecordButton=new IncomeRecordButton("中央控制器",f);
}
錯誤提示:incomeRecordButton 變量無效
請問這是甚麼原因,謝謝!