package exception;
import javax.swing.JButton;
import javax.swing.JPanel;
public class JpanelDemo {
public static void main (String[] args){
BaseFrame f = new BaseFrame("JPanel演示");
JPanel panel_1 = new JPanel();
JPanel panel_2 = new JPanel();
JButton button_1 = new JButton("按钮一");
JButton button_2 = new JButton("按钮二");
JButton button_3 = new JButton("按钮三");
panel_1.add(button_1);
panel_2.add(button_2);
panel_2.add(button_3);
f.add(panel_1);
f.add(panel_2);
f.showMe();
f.setVisible(true);
}
}
JFrame呢?再加个import javax.swing*,应该是吧!!
报错信息呢?