Java Reference
In-Depth Information
69 setStatus();
70 // notify the table, too
71 model.fireTableDataChanged();
72 } // TODO: else infodialog or Beep.
73 }
74 }
75 } ;
76
77 // TEST ONLY:
78 int testid = 0;
79
80 BudgetPro(JFrame frame, String username, String value)
81 {
82 this.frame = frame;
83 top = new Account("TopLevel", new User(username), value);
84 current = top;
85
86 } // constructor
87
88 private Component
89 createStatus()
90 {
91 JPanel retval = new JPanel(); // default: flow layout
92
93 upton.addActionListener(upAction);
94
95 nam = new JLabel("Account: Name");
96 tot = new JLabel("Total: $");
97 val = new JLabel("Remaining: $");
98
99 retval.add(upton);
100 retval.add(nam);
101 retval.add(tot);
102 retval.add(val);
103
104 setStatus();
105
106 return retval;
107 } // createStatus
108
109 /**
110 * Set the values of the status fields,
111 * as when the account has changed.
112 */
113 private void
114 setStatus()
115 {
116 nam.setText("Account: "+current.getName());
117 tot.setText("Total: $"+current.getTotal());
Search WWH ::




Custom Search