Sams Teach Yourself Java™ in 24 Hours (Covering Java 7 and Android)

(singke) #1
ptg7068951

Completing a Graphical Application 215

73: row2.add(winners[i]);
74: }
75: add(row2);
76:
77: FlowLayout layout3 = new FlowLayout(FlowLayout.CENTER,
78: 10, 10);
79: row3.setLayout(layout3);
80: stop.setEnabled(false);
81: row3.add(stop);
82: row3.add(play);
83: row3.add(reset);
84: add(row3);
85:
86: GridLayout layout4 = new GridLayout(2, 3, 20, 10);
87: row4.setLayout(layout4);
88: row4.add(got3Label);
89: got3.setEditable(false);
90: row4.add(got3);
91: row4.add(got4Label);
92: got4.setEditable(false);
93: row4.add(got4);
94: row4.add(got5Label);
95: got5.setEditable(false);
96: row4.add(got5);
97: row4.add(got6Label);
98: got6.setEditable(false);
99: row4.add(got6);
100: row4.add(drawingsLabel);
101: drawings.setEditable(false);
102: row4.add(drawings);
103: row4.add(yearsLabel);
104: years.setEditable(false);
105: row4.add(years);
106: add(row4);
107:
108: setVisible(true);
109: }
110:
111: private voidsetLookAndFeel() {
112: try {
113: UIManager.setLookAndFeel(
114: “com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel”
115: );
116: } catch(Exception exc) {
117: // ignore error
118: }
119: }
120:
121: public static void main(String[] arguments) {
122: LottoMadness frame = new LottoMadness();
123: }
124: }


LISTING 15.3 Continued

Free download pdf