/******************************* / CardPanel.java / Written by Timothy M. Bailey / Started: March 31, 1998 / Updated: April 13, 1998 / / Part Wheel of Fortune applet for cs406 class with Dr. Roger Webster / ********************************/ import java.awt.*; import java.applet.*; import java.net.*; public class CardPanel extends Panel { public Panel cards; CardLayout cardLayout; public Panel spinWheel, chooseVowel, solvePuzzle; TextField solveField; Label solveLabel; Button solve; Button b, c, d, f, g, h, j, k, l, m, n, p, q, r, s, t, v, w, x, y, z; Button a, e, i, o, u; public CardPanel() { this.setLayout(new BorderLayout()); cards = new Panel(); cardLayout = new CardLayout(); cards.setLayout(cardLayout); spinWheel = new Panel(); spinWheel.setLayout(new GridLayout(3, 7)); b = new Button("B"); c = new Button("C"); d = new Button("D"); f = new Button("F"); g = new Button("G"); h = new Button("H"); j = new Button("J"); k = new Button("K"); l = new Button("L"); m = new Button("M"); n = new Button("N"); p = new Button("P"); q = new Button("Q"); r = new Button("R"); s = new Button("S"); t = new Button("T"); v = new Button("V"); w = new Button("W"); x = new Button("X"); y = new Button("Y"); z = new Button("Z"); b.setBackground(Color.yellow); c.setBackground(Color.yellow); d.setBackground(Color.yellow); f.setBackground(Color.yellow); g.setBackground(Color.yellow); h.setBackground(Color.yellow); j.setBackground(Color.yellow); k.setBackground(Color.yellow); l.setBackground(Color.yellow); m.setBackground(Color.yellow); n.setBackground(Color.yellow); p.setBackground(Color.yellow); q.setBackground(Color.yellow); r.setBackground(Color.yellow); s.setBackground(Color.yellow); t.setBackground(Color.yellow); v.setBackground(Color.yellow); w.setBackground(Color.yellow); x.setBackground(Color.yellow); y.setBackground(Color.yellow); z.setBackground(Color.yellow); spinWheel.add(b); spinWheel.add(c); spinWheel.add(d); spinWheel.add(f); spinWheel.add(g); spinWheel.add(h); spinWheel.add(j); spinWheel.add(k); spinWheel.add(l); spinWheel.add(m); spinWheel.add(n); spinWheel.add(p); spinWheel.add(q); spinWheel.add(r); spinWheel.add(s); spinWheel.add(t); spinWheel.add(v); spinWheel.add(w); spinWheel.add(x); spinWheel.add(y); spinWheel.add(z); cards.add("Spin", spinWheel); chooseVowel = new Panel(); chooseVowel.setLayout(new GridLayout(1,5)); a = new Button("A"); e = new Button("E"); i = new Button("I"); o = new Button("O"); u = new Button("U"); a.setBackground(Color.yellow); e.setBackground(Color.yellow); i.setBackground(Color.yellow); o.setBackground(Color.yellow); u.setBackground(Color.yellow); chooseVowel.add(a); chooseVowel.add(e); chooseVowel.add(i); chooseVowel.add(o); chooseVowel.add(u); cards.add("Vowel", chooseVowel); solvePuzzle = new Panel(); solvePuzzle.setLayout(new BorderLayout()); solveLabel = new Label("Solve the puzzle:", Label.CENTER); solveLabel.setFont(new Font("TimesRoman", Font.BOLD, 18)); solvePuzzle.add("North", solveLabel); solve = new Button("Click Here When Done"); solvePuzzle.add("South", solve); solveField = new TextField("", 50); solveField.setFont(new Font("TimesRoman", Font.PLAIN, 18)); solvePuzzle.add("Center", solveField); cards.add("Solve", solvePuzzle); this.add("Center", cards); } public void paint (Graphics g) { this.reshape(300, 425, 500, 150); } }