質問 public class jp2 implements ActionListener{ static int num; static Button btn= new Button("Button1");//ボタンの作成 JFrame frm = new JFrame("Java");//フレームの作成 JPanel panel = new JPanel(null); JPanel panel2 = new JPanel(null); public jp2(){ //フレーム frm.setLayout(new BorderLayout()); frm.setSize(new Dimension(300,240)); //メインパネル panel.setBackground( new Color( 255,255,255 ) ); //パネル2 panel2.setBackground( new Color( 255,0,0 ) );