org.accountkeeper
Class AccountKeeper

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--javax.swing.JFrame
                                |
                                +--org.accountkeeper.AccountKeeper

public class AccountKeeper
extends javax.swing.JFrame

This is the main class of the Account Keeper application. It uses Swing and the Java look and feel. The static entry point is main.

The UI for this application was generated by JBuilder. Any class that has UI components will have a method called jbInit that initializes the UI. Additionally, any section of the code that has been generated by JBuilder will be marked with [JBuilder].

Version:
1.0
Author:
Thornton Rose
See Also:
Serialized Form

Inner classes inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AWTTreeLock
 
Field Summary
private  javax.swing.JButton aboutButton
           
private  org.accountkeeper.AccountForm acctForm
           
private  org.accountkeeper.AccountList acctList
           
private  org.accountkeeper.AccountTable acctTable
           
private  org.accountkeeper.AccountTableModel acctTableModel
           
private  javax.swing.JButton addButton
           
private  java.awt.GridLayout buttonGridLayout1
           
private  java.awt.GridLayout buttonGridLayout2
           
private  javax.swing.JPanel buttonPanel1
           
private  javax.swing.JPanel buttonPanel2
           
private  java.awt.CardLayout contentCardLayout
           
private  javax.swing.JPanel contentPanel
           
private  java.awt.BorderLayout controlBorderLayout
           
private  java.awt.CardLayout controlCardLayout
           
private  javax.swing.JPanel controlInnerPanel
           
private  javax.swing.JPanel controlPanel
           
private  javax.swing.border.SoftBevelBorder controlPanelBorder
           
private  javax.swing.JButton deleteButton
           
private  javax.swing.JButton editButton
           
private  java.awt.BorderLayout mainBorderLayout
           
private  javax.swing.border.SoftBevelBorder tableBorder
           
private  javax.swing.JScrollPane tableScrollPane
           
private static java.lang.String TITLE
           
private static java.lang.String VERSION
           
 
Fields inherited from class javax.swing.JFrame
accessibleContext, defaultCloseOperation, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
base, CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, frameSerializedDataVersion, HAND_CURSOR, icon, ICONIFIED, mbManagement, menuBar, MOVE_CURSOR, N_RESIZE_CURSOR, nameCounter, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, ownedWindows, resizable, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, serialVersionUID, state, SW_RESIZE_CURSOR, TEXT_CURSOR, title, W_RESIZE_CURSOR, WAIT_CURSOR, weakThis
 
Fields inherited from class java.awt.Window
active, base, focusMgr, inputContext, nameCounter, OPENED, ownedWindowList, serialVersionUID, state, warningString, weakThis, windowListener, windowSerializedDataVersion
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dispatcher, layoutMgr, maxSize, ncomponents, serialVersionUID
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, assert, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, hasFocus, height, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, serialVersionUID, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowListenerK, x, y
 
Constructor Summary
AccountKeeper()
          Construct a new instance of the class.
 
Method Summary
private  void addAccount()
          Add a journal entry.
private  void addListeners()
          Add listeners to any components that need to be observed.
private  void deleteAccount()
          Delete the journal entry that is selected in the log table, after confirmation.
private  void editAccount()
          Edit the journal entry that is selected in the journal table.
private  org.accountkeeper.AccountForm getAccountForm()
          Get the journal entry form, which is used for entering/editing the given journal entry.
private  void jbInit()
          Initialize UI [JBuilder].
static void main(java.lang.String[] args)
          Start the application.
private  void save()
          Save the account list.
private  void showAbout()
          Show application identification and copyright information.
private  void showControls()
          Show (enable/disable) the controls based on the state of the account list.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, createRootPaneException, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
, addNotify, addToFrameList, constructComponentName, finalize, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, initIDs, isResizable, postProcessKeyEvent, readObject, remove, removeFromFrameList, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle, writeObject
 
Methods inherited from class java.awt.Window
addOwnedWindow, addWindowListener, applyResourceBundle, applyResourceBundle, connectOwnedWindow, dispatchEventImpl, dispose, eventEnabled, getFocusOwner, getInputContext, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isActive, isShowing, nextFocus, ownedInit, pack, postEvent, postWindowEvent, preProcessKeyEvent, processEvent, removeOwnedWindow, removeWindowListener, setCursor, setFocusOwner, setWarningString, show, toBack, toFront, transferFocus
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyOrientation, countComponents, deliverEvent, dispatchEventToSelf, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getCursorTarget, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPrint, list, list, locate, minimumSize, paint, paintComponents, postsOldMouseEvents, preferredSize, print, printComponents, printHeavyweightComponents, printOneComponent, processContainerEvent, proxyEnableEvents, proxyRequestFocus, remove, removeAll, removeContainerListener, setFont, updateCursor, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getIntrinsicCursor, getLocation, getLocation, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

TITLE

private static final java.lang.String TITLE

VERSION

private static final java.lang.String VERSION

acctList

private org.accountkeeper.AccountList acctList

acctTableModel

private org.accountkeeper.AccountTableModel acctTableModel

acctForm

private org.accountkeeper.AccountForm acctForm

mainBorderLayout

private java.awt.BorderLayout mainBorderLayout

tableBorder

private javax.swing.border.SoftBevelBorder tableBorder

controlPanelBorder

private javax.swing.border.SoftBevelBorder controlPanelBorder

contentPanel

private javax.swing.JPanel contentPanel

tableScrollPane

private javax.swing.JScrollPane tableScrollPane

acctTable

private org.accountkeeper.AccountTable acctTable

controlPanel

private javax.swing.JPanel controlPanel

controlCardLayout

private java.awt.CardLayout controlCardLayout

controlInnerPanel

private javax.swing.JPanel controlInnerPanel

controlBorderLayout

private java.awt.BorderLayout controlBorderLayout

contentCardLayout

private java.awt.CardLayout contentCardLayout

buttonPanel1

private javax.swing.JPanel buttonPanel1

buttonPanel2

private javax.swing.JPanel buttonPanel2

buttonGridLayout1

private java.awt.GridLayout buttonGridLayout1

buttonGridLayout2

private java.awt.GridLayout buttonGridLayout2

addButton

private javax.swing.JButton addButton

editButton

private javax.swing.JButton editButton

deleteButton

private javax.swing.JButton deleteButton

aboutButton

private javax.swing.JButton aboutButton
Constructor Detail

AccountKeeper

public AccountKeeper()
Construct a new instance of the class.
Method Detail

jbInit

private void jbInit()
Initialize UI [JBuilder].

addListeners

private void addListeners()
Add listeners to any components that need to be observed. These include, but are not limited to: the window, the table, buttons, menu items.

showAbout

private void showAbout()
Show application identification and copyright information.

showControls

private void showControls()
Show (enable/disable) the controls based on the state of the account list. In particular, if a row is selected in the list, the Edit and Delete buttons are enabled.

getAccountForm

private org.accountkeeper.AccountForm getAccountForm()
Get the journal entry form, which is used for entering/editing the given journal entry. Note that if the form is null, it is created.
Returns:
Journal entry form.

addAccount

private void addAccount()
Add a journal entry. The user is presented with the Log Entry Form, where he can enter journal entry information and select Save or Cancel. If the user selects Save, the entry is added.

editAccount

private void editAccount()
Edit the journal entry that is selected in the journal table. The user is presented with the journal entry form, where he can enter journal entry and select Save or Cancel. If the user selects Save, the journal entry will be updated.

Note that the journal entry is cloned before it is passed to the entry form, so that it can be discarded if the user cancels his changes. If the user saves his changes, the entry in the journal is replaced with the updated entry.

deleteAccount

private void deleteAccount()
Delete the journal entry that is selected in the log table, after confirmation. The user is presented with a simple yes/no dialog to confirm deletion. If the user selects Yes, the selected journal entry is deleted.

save

private void save()
Save the account list.

main

public static void main(java.lang.String[] args)
Start the application.