MCPcopy Create free account
hub / github.com/BruceEckel/OnJava8-Examples / Boxes

Method Boxes

patterns/BoxObserver.java:24–34  ·  view source on GitHub ↗
(int grid)

Source from the content-addressed store, hash-verified

22 }
23 };
24 public Boxes(int grid) {
25 setTitle("Demonstrates Observer pattern");
26 Container cp = getContentPane();
27 cp.setLayout(new GridLayout(grid, grid));
28 for(int x = 0; x < grid; x++)
29 for(int y = 0; y < grid; y++)
30 cp.add(new Box(x, y, notifier));
31 setSize(500, 400);
32 setVisible(true);
33 setDefaultCloseOperation(DISPOSE_ON_CLOSE);
34 }
35}
36
37@SuppressWarnings("deprecation")

Callers

nothing calls this directly

Calls 2

setTitleMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected