use of com.moneychanger.core.Account in project otapij by FellowTraveler.
the class Helpers method reloadOTDetails.
// OT Helpers
public static void reloadOTDetails(String accountID) {
Account account = new OpenTransactionAccount();
Object details = account.getAccountDetails(accountID);
OTDetails otDetails = (OTDetails) details;
populateOTDetails(otDetails);
JTable table = MainPage.getAccountTable();
((AccountTableModel) table.getModel()).setValueAt(otDetails.getBalance(), table.getSelectedRow(), 1);
}
use of com.moneychanger.core.Account in project otapij by FellowTraveler.
the class AccountEditDialog method jButton_ContinueActionPerformed.
// </editor-fold>//GEN-END:initComponents
private void jButton_ContinueActionPerformed(java.awt.event.ActionEvent evt) {
//GEN-FIRST:event_jButton_ContinueActionPerformed
try {
if ("CashPurseAccount".equals(type)) {
JOptionPane.showMessageDialog(this, "Cash Purse Account label cannot not be edited", "Cash Purse label edit", JOptionPane.ERROR_MESSAGE);
return;
}
Account account = null;
Class obj = Class.forName("com.moneychanger.core." + type);
account = (Account) obj.newInstance();
boolean status = account.editLabel(accountID, jTextField_NewLabel.getText());
if (status) {
JOptionPane.showMessageDialog(this, "Account edited successfully", "Edit Success", JOptionPane.INFORMATION_MESSAGE);
} else {
JOptionPane.showMessageDialog(this, "Account could not be edited", "Failure", JOptionPane.ERROR_MESSAGE);
}
this.dispose();
} catch (InstantiationException ex) {
Logger.getLogger(AccountEditDialog.class.getName()).log(Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
Logger.getLogger(AccountEditDialog.class.getName()).log(Level.SEVERE, null, ex);
} catch (ClassNotFoundException ex) {
Logger.getLogger(AccountEditDialog.class.getName()).log(Level.SEVERE, null, ex);
}
}
Aggregations