Commit 4bdec1ba authored by Trisha Gee's avatar Trisha Gee
Browse files

[Ch15] Add a button to the panel

parent 386a95d1
Loading
Loading
Loading
Loading
+5 −0
Changes for src/main/java/ch15/Panel1.java: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -15,9 +15,14 @@ public class Panel1 {
    JFrame frame = new JFrame();
    JPanel panel = new JPanel();
    panel.setBackground(Color.darkGray);

    JButton button = new JButton("shock me");
    panel.add(button);

    frame.getContentPane().add(BorderLayout.EAST, panel);
    frame.setSize(200, 200);
    frame.setVisible(true);
  }

}
   
 No newline at end of file