/*
* Copyright 2007 Sun Microsystems, Inc.
* All rights reserved. You may not modify, use,
* reproduce, or distribute this software except in
* compliance with the terms of the License at:
* http://developer.sun.com/berkeley_license.html
*/
package com.sun.tutorial.javaee.dukesbank.client;
import com.sun.tutorial.javaee.dukesbank.exception.AccountNotFoundException;
import com.sun.tutorial.javaee.dukesbank.exception.CustomerNotFoundException;
import com.sun.tutorial.javaee.dukesbank.exception.IllegalAccountTypeException;
import com.sun.tutorial.javaee.dukesbank.exception.InvalidParameterException;
import com.sun.tutorial.javaee.dukesbank.request.AccountController;
import com.sun.tutorial.javaee.dukesbank.request.CustomerController;
import com.sun.tutorial.javaee.dukesbank.util.AccountDetails;
import com.sun.tutorial.javaee.dukesbank.util.CustomerDetails;
import java.math.BigDecimal;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import javax.ejb.EJB;
import javax.swing.DefaultListModel;
/**
*
* @author ian
*/
public class BankAdmin extends javax.swing.JFrame {
@EJB
private static CustomerController customerController;
@EJB
private static AccountController accountController;
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JPanel accountActionsPanel;
private javax.swing.JButton accountCancelButton;
private javax.swing.JButton accountCreateButton;
private javax.swing.JLabel accountDescriptionLabel;
private javax.swing.JTextField accountDescriptionTextField;
private javax.swing.JLabel accountIdLabel;
private javax.swing.JTextField accountIdTextField;
private javax.swing.JPanel accountInfoPanel;
private javax.swing.JButton accountNewButton;
private javax.swing.JButton accountOpenButton;
private javax.swing.JButton accountRemoveButton;
private javax.swing.JComboBox accountTypeComboBox;
private javax.swing.JLabel accountTypeLabel;
private javax.swing.JButton addCustomerToAccountButton;
private javax.swing.JLabel addCustomerToAccountLabel;
private javax.swing.JTextField addCustomerToAccountTextField;
private javax.swing.JLabel balanceLabel;
private javax.swing.JTextField balanceTextField;
private javax.swing.JLabel beginningBalanceLabel;
private javax.swing.JTextField beginningBalanceTextField;
private javax.swing.JLabel cityLabel;
private javax.swing.JTextField cityTextField;
private javax.swing.JMenuItem copyMenuItem;
private javax.swing.JLabel creditLabel;
private javax.swing.JTextField creditTextField;
private javax.swing.JButton customerCancelButton;
private javax.swing.JLabel customerIdLabel;
private javax.swing.JTextField customerIdTextField;
private javax.swing.JPanel customerInfoPanel;
private javax.swing.JButton customerNewButton;
private javax.swing.JButton customerOpenButton;
private javax.swing.JButton customerRemoveButton;
private javax.swing.JButton customerSearchButton;
private javax.swing.JLabel customerSearchLabel;
private javax.swing.JList customerSearchList;
private javax.swing.JPanel customerSearchPanel;
private javax.swing.JScrollPane customerSearchScrollPane;
private javax.swing.JTextField customerSearchTextField;
private javax.swing.JButton customerUpdateButton;
private javax.swing.JLabel customersLabel;
private javax.swing.JTextField customersTextField;
private javax.swing.JMenuItem cutMenuItem;
private javax.swing.JMenuItem deleteMenuItem;
private javax.swing.JMenu editMenu;
private javax.swing.JLabel emailLabel;
private javax.swing.JTextField emailTextField;
private javax.swing.JMenuItem exitMenuItem;
private javax.swing.JMenu fileMenu;
private javax.swing.JLabel firstNameLabel;
private javax.swing.JTextField firstNameTextField;
private javax.swing.JTabbedPane jTabbedPane1;
private javax.swing.JLabel lastNameLabel;
private javax.swing.JTextField lastNameTextField;
private javax.swing.JMenuBar menuBar;
private javax.swing.JLabel messageLabel;
private javax.swing.JPanel messagePanel;
private javax.swing.JLabel messageTextLabel;
private javax.swing.JLabel middleInitialLabel;
private javax.swing.JTextField middleInitialTextField;
private javax.swing.JMenuItem pasteMenuItem;
private javax.swing.JLabel phoneLabel;
private javax.swing.JTextField phoneTextField;
private javax.swing.JButton removeCustomerFromAccountButton;
private javax.swing.JLabel stateLabel;
private javax.swing.JTextField stateTextField;
private javax.swing.JLabel streetLabel;
private javax.swing.JTextField streetTextField;
private javax.swing.JLabel timeLabel;
private javax.swing.JTextField timeTextField;
private javax.swing.JLabel zipLabel;
private javax.swing.JTextField zipTextField;
private boolean isNewAccount;
private boolean isNewCustomer;
/** Creates new form BankAdmin */
public BankAdmin() {
initComponents();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
jTabbedPane1 = new javax.swing.JTabbedPane();
customerInfoPanel = new javax.swing.JPanel();
customerIdLabel = new javax.swing.JLabel();
firstNameLabel = new javax.swing.JLabel();
lastNameLabel = new javax.swing.JLabel();
middleInitialLabel = new javax.swing.JLabel();
streetLabel = new javax.swing.JLabel();
cityLabel = new javax.swing.JLabel();
stateLabel = new javax.swing.JLabel();
zipLabel = new javax.swing.JLabel();
phoneLabel = new javax.swing.JLabel();
emailLabel = new javax.swing.JLabel();
customerIdTextField = new javax.swing.JTextField();
firstNameTextField = new javax.swing.JTextField();
lastNameTextField = new javax.swing.JTextField();
middleInitialTextField = new javax.swing.JTextField();
streetTextField = new javax.swing.JTextField();
cityTextField = new javax.swing.JTextField();
stateTextField = new javax.swing.JTextField();
zipTextField = new javax.swing.JTextField();
phoneTextField = new javax.swing.JTextField();
emailTextField = new javax.swing.JTextField();
customerOpenButton = new javax.swing.JButton();
customerNewButton = new javax.swing.JButton();
customerUpdateButton = new javax.swing.JButton();
customerRemoveButton = new javax.swing.JButton();
customerCancelButton = new javax.swing.JButton();
customerSearchPanel = new javax.swing.JPanel();
customerSearchLabel = new javax.swing.JLabel();
customerSearchTextField = new javax.swing.JTextField();
customerSearchButton = new javax.swing.JButton();
customerSearchScrollPane = new javax.swing.JScrollPane();
customerSearchList = new javax.swing.JList();
accountInfoPanel = new javax.swing.JPanel();
accountIdLabel = new javax.swing.JLabel();
accountDescriptionLabel = new javax.swing.JLabel();
accountTypeLabel = new javax.swing.JLabel();
balanceLabel = new javax.swing.JLabel();
creditLabel = new javax.swing.JLabel();
beginningBalanceLabel = new javax.swing.JLabel();
customersLabel = new javax.swing.JLabel();
timeLabel = new javax.swing.JLabel();
accountOpenButton = new javax.swing.JButton();
accountNewButton = new javax.swing.JButton();
accountCreateButton = new javax.swing.JButton();
accountRemoveButton = new javax.swing.JButton();
评论0