15 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
16 JButton button =
new JButton(
"Change colors");
17 button.addActionListener(
this);
18 MyDrawPanel2 drawPanel =
new MyDrawPanel2();
19 frame.add(button, BorderLayout.SOUTH);
20 frame.add(drawPanel, BorderLayout.CENTER);
21 frame.setSize(300, 300);
22 frame.setVisible(
true);