Java Reference
In-Depth Information
21 // gui components
22 private JFrame frame; // needed by dialogs to root themselves
23 private JLabel nam;
24 private JLabel tot;
25 private JLabel val;
26 private JButton upton = new JButton(
new ImageIcon("net/multitool/gui/back.gif"));
27 private JButton creat = new JButton("New Subaccount");
28 private JButton view = new JButton("View Subaccount");
29 private JButton clos = new JButton("Quit");
30
31 private JTable list;
32 private AbstractTableModel model;
33
34 private AcctDialog askem; // make once, use often
35
36 // Set Up an Action for a Button
37 private ActionListener upAction = new ActionListener()
38 {
39 public void
40 actionPerformed(ActionEvent e)
41 {
42 // this is the action for UP arrow icon;
43 Account next;
44 next = current.getParent();
45 if (next != null) {
46 current = next;
47 setStatus();
48 // TODO: notify the table, too
49 model.fireTableDataChanged();
50 } // TODO: else infodialog or Beep.
51 }
52 } ;
53
54 private ActionListener cdAction = new ActionListener()
55 {
56 public void
57 actionPerformed(ActionEvent e)
58 {
59 // this is the action for VIEW subdirectory;
60 // a "cd" into the subaccount.
61 int row = list.getSelectedRow();
62 // System.out.println("Row="+row); // DEBUG; TODO: REMOVE
63 if (row > -1) { // only if a row was selected
64 String subname = (String) model.getValueAt(row, 0); // name column
65 Account next = current.getSub(subname);
66 if (next != null) {
67 current = next;
68 // System.out.println("cd to:"+current.getName());
Search WWH ::




Custom Search