13.07.2015 Views

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

530Appendix BA Java Swing GUI for BudgetPro118 // tot.setText("SubAccounts: "+current.size());119 val.setText("Remaining: $"+current.getBalance());120121 // disable the butt<strong>on</strong> if there is no "up" to go122 if (current.getParent() == null) {123 upt<strong>on</strong>.setEnabled(false);124 } else {125 upt<strong>on</strong>.setEnabled(true);126 }127128 } // setStatus129130 private Comp<strong>on</strong>ent131 createList()132 {133 JScrollPane retval;134135 model = new AbstractTableModel()136 {137 private String [] columnNames = {"Account", "Owner", "Value"};138139 public String140 getColumnName(int col) {141 return columnNames[col];142 } // getColumnName143144 public int145 getRowCount()146 {147 int retval;148149 if (current != null) {150 retval = current.size();151 } else {152 retval = 1; // testing <strong>on</strong>ly153 }154155 return retval;156157 } // getRowCount158159 public int getColumnCount() { return columnNames.length; }160161 public Object162 getValueAt(int row, int col) {163 Object retval = null;164 Account aa = null;165 // return "---"; // rowData[row][col];166 int count = 0;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!