Commit 37fe38a6 authored by Trisha Gee's avatar Trisha Gee
Browse files

[Ch15] Add two buttons to the panel

parent 4bdec1ba
Loading
Loading
Loading
Loading
+4 −2
Changes for src/main/java/ch15/Panel1.java: 4 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -10,17 +10,19 @@ public class Panel1 {
    gui.go();
  }


  public void go() {
    JFrame frame = new JFrame();
    JPanel panel = new JPanel();
    panel.setBackground(Color.darkGray);

    JButton button = new JButton("shock me");
    JButton buttonTwo = new JButton("bliss");

    panel.add(button);
    panel.add(buttonTwo);

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