在我的一门类(class)中出现错误“找不到符号”。我在这里做错了什么? 我需要事先声明它们吗?
在我的一门类(class)中出现错误“找不到符号”。我在这里做错了什么? 我需要事先声明它们吗?
尝试使其看起来像这样:
package userInterface;
import javax.swing.JPanel;
import java.awt.*;
import javax.swing.JButton;
/**
*
* @author
*/
public class AddAirport {
private JPanel mainPane;
public AddAirport(JPanel mainPane){
GridBagLayout gridBagLayout;
gridBagConstraints constraints;
JPanel buttonPane;
JPanel dataPane;
BorderLayout borderLayout;
JButton addBtn;
JButton canxBtn;
JLabel newAirport;
JLabel enterName;
JTextField airportName;
JLabel enterCity;
JTextField airportCity;
JLabel selectState;
JComboBox airportState;
JLabel enterCode;
}
}
最佳答案
打错了:
gridBagConstraints constraints;
应该是
GridBagConstraints constraints;
(大写 G)。祝你好运!
关于java - 配置 GUI 时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22431214/