Java Swing, 2nd EditionCode Examples |
The file jswing2.zip (3.2MB) contains all of the code examples from the book in one lump. (It also includes the index of individual examples you see below.) The various tools (EEL and MacMetrics, for example) and miscellaneous resources like the classic Key Events discussion or the expanded HTML Editor Kit section can be found here.
Chapter 2 | ||
---|---|---|
Class | Description | Source |
CCPHandler | A simple event handler to display cut/copy/paste events. | |
CopyAction | A simple Action that copies text from a PageFrame object. | |
CutAction | A simple Action that copies text from a PageFrame object. | |
LnFListener | A listener that can change the look-and-feel of a frame based on the actionCommand of an ActionEvent object. Supported look-and-feels are: Mac, Metal, Motif, Windows. Not all L&Fs will be available on a given machine. Notably, the Mac and Windows L&Fs work only on their specific platforms. | |
PageFrame | A simple extension of the JInternalFrame class that contains a list object. Elements of the list represent HTML pages for a web site. | |
PasteAction | A simple Action that pastes text into a PageFrame object. | |
SimpleInternalFrame | A quick demonstration of setting up an internal frame in an application. | |
SiteFrame | A simple extension of the JInternalFrame class that contains a list object. Elements of the list represent HTML pages for a web site. | |
SiteManager | A sample Swing application that manages several internal frames. This is the main class for working with the SiteFrame and PageFrame classes. | |
ToolbarFrame1 | A simple frame containing a "toolbar" made up of several java.awt.Button objects. We'll be converting the Buttons to JButtons in the ToolbarFrame2.java file. | |
ToolbarFrame2 | The Swing-ified button example. | |
ToolbarFrame3 | The Swing-ified button example. The buttons in this toolbar all carry images but no text. | |
Chapter 3 | ||
Class | Description | Source |
ActionExample | This example creates a menubar and toolbar both populated with Action objects. | |
GuiScreens | A quick utility to print out graphic device information. Will work on systems with multiple monitors. | |
Chapter 4 | ||
Class | Description | Source |
AlignmentExample | A simple demonstration of text alignment in JLabels. | |
AnimationApplet | The classic animation applet rewritten to use an animated GIF. | |
DynamicIconExample | Example of an icon that changes form. | |
HtmlLabel | A JLabel that uses inline HTML to format its text. | |
ImageLabelExample | Variations on a text & icon label. The icon and text are aligned in different ways for each label. | |
MnemonicLabels | Shows how displayedMnemonic and labelFor properties work together | |
OvalIcon | A simple icon implementation that draws ovals. | |
SimpleJLabelExample | A quick application to show a simple JLabel. | |
TestOval | A simple application to test the functionality of the OvalIcon class. | |
Chapter 5 | ||
Class | Description | Source |
ActionExample | An application that shows the Action class in, well, action. | |
DefaultButtonExample | Example using defaultButton and JRootPane.setDefaultButton() | |
FancyButton | Create a JButton that does not show focus, does not paint a border, and displays different icons when rolled-over and pressed. | |
JButtonEvents | A simple demonstration of button events including Action, Item and Change event types. | |
JToggleButtonEvents | The event demonstration program for JToggleButton. | |
SimpleButtonGroupExample | A ButtonGroup voting booth. | |
Chapter 6 | ||
Class | Description | Source |
Bounded | A demonstration of the ChangeEvents generated by the BoundedRangeModel. | |
ProgressBarExample | A demonstration of the JProgressBar component. The component tracks the progress of a for loop. | |
ProgressMonitorExample | A demonstration of the ProgressMonitor toolbar. A timer is used to induce progress. This example also shows how to use the UIManager properties associated with progress monitors. | |
ProgressMonitorInputExample | Similar to the ProgressMonitorExample except that we can now use an actual input file to monitor rather than inducing progress manually. The file to load should be passed as a command line argument. | |
ScrollBarExample | A quick demonstration of JScrollBar (both vertical and horizontal). | |
SliderExample | An example of JSlider with default labels. | |
Chapter 7 | ||
Class | Description | Source |
BookCellRenderer | A custom cell renderer for BookEntry objects. | |
BookEntry | A simple aggregate class to store a book's title and icon. | |
ComboBoxEditorExample | A custom combobox editor for use with the EditableComboBox class. | |
EditableComboBox | A fancy example of JComboBox with a custom renderer and editor used to display a list of JLabel objects that include both text and icons. | |
IconEditor | An editor for use with the JSpinner component. This editor can display an icon from a list stored in the spinner. | |
IconSpinner | An implementation of JSpinner with customized content--icons in this case. A standard spinner model is used with a custom editor (IconEditor.java). | |
ListExample | An example of the JList component in action. This program uses a custom renderer (BookCellRenderer.java) to show a list of books with icons of their covers. | |
ListModelExample | An example of JList with a DefaultListModel that we build up at runtime. | |
MonthSpinner | An example of JSpinner with a custom editor that allows the user to spin through dates of the mm/yy format. | |
RolloverSpinnerListModel | A custom spinner model that rolls over the end of a list back to the beginning (or vice versa). | |
SelectionMonitor | A graphical list selection monitor. | |
SimpleList | A simple example of a JList object built from an array of Strings. | |
SimpleList2 | A variation on SimpleList. This version modifies the selection model used. | |
SpinnerTest | A quick test of various spinners. | |
Chapter 8 | ||
Class | Description | Source |
ExitFrame | A very simple extension of JFrame that defaults to EXIT_ON_CLOSE for its close operation. Relies on the 1.3 or higher SDK. | |
FrameClose1 | A demonstration of the SDK 1.3 EXIT_ON_CLOSE behavior for JFrames. | |
FrameClose2 | A demonstration of the WindowListener approach to closing JFrames. | |
GlassExample | Show how a glass pane can be used to block mouse events. updated GlassExample | |
OpaqueExample | Creates two JPanels (opaque), one containing another opaque JPanel, and the other containing a non-opaque JPanel. | |
RevalidateExample | An example of using the revalidate() method to dynamically update the appearance of a component. This example changes the size of a button's font on the fly. | |
RootExample | An example of interacting directly with the JRootPane of a JFrame. | |
RootExample2 | Another example of interacting with the root pane. We set the menubar for the frame directly through the root pane in this example. | |
RootExample3 | Similar to RootExample2, but this version uses the setJMenuBar() method from JFrame to attach the menu. No (direct) interaction with JRootPane is needed. | |
SimpleApplet | An example of the JApplet class. For use with the applet.html file. | |
SimpleApplet2 | A contrived example of how to add components to an applet after it has been initialized. Code to disable the event queue checking is included (but commented out) for use with older plug-ins. | |
SimpleFrame | A simple example of the JFrame class. | |
SimpleLayers | A demonstration of the JLayeredPane class. | |
SplashScreen | A simple application to show a title screen in the center of the screen for the amount of time given in the constructor. This class includes a sample main() method to test the splash screen, but it's meant for use with other applications. | |
Chapter 9 | ||
Class | Description | Source |
Figure3 | An example that shows how to do a few interesting things using JInternalFrames, JDesktopPane, and DesktopManager. | |
SampleDesktop | Another example that shows how to do a few interesting things using JInternalFrames, JDesktopPane, and DesktopManager. | |
SampleDesktopMgr | A DesktopManager that keeps its frames inside the desktop. | |
SimpleInternalFrame | A quick demonstration of setting up an Internal Frame in an application. | |
TileAction | An action that tiles all internal frames when requested. | |
Chapter 10 | ||
Class | Description | Source |
DialogDesktop | A frame that can easily support internal frame dialogs. | |
ManyOptions | An example of using the JOptionPane with a custom list of options in an input dialog. | |
OptPaneComparison | A quick utility class to help you see the differences between various types of option panes, both via internal frames and using standalone popups. | |
Chapter 11 | ||
Class | Description | Source |
CompassButtons | A demonstration of the SpringLayout class. This application puts directional buttons on a panel and keeps them close to the edges of the panel regardless of the panel's size. | |
CompassScroller | A simple ActionListener that can move the view of a viewport north, south, east and west by specified units. | |
FractionSpring | A Spring extension that calculates its values based on an anchor Spring and a multiplier (> 0.0). Note that values greater than 1.0 can be used. | |
HBox | A quick test of the BoxLayout manager using the Box utility class. | |
HBoxWithGlue | A quick test of the BoxLayout manager using the Box utility class. | |
HBoxWithStrut | Another test of the BoxLayout manager using the Box utility class. This version separates several components with a fixed width gap. | |
OverlayTest | A test of the OverlayLayout manager allowing experimentation. | |
ScrollDemo | A simple JScrollPane demonstration. | |
ScrollDemo2 | Another JScrollPane demonstration. This version activates some of the features of JScrollPane such as row and column headers. | |
ScrollList | A simple JScrollPane for a JList component. | |
SimpleSplitPane | A quick test of the JSplitPane class. | |
SimpleTab | A quick test of the JTabbedPane component. | |
SysConfig | A demonstration of the JTabbedPane class for displaying and manipulating configuration information. The BoxLayout class is used to lay out the first tab quickly. | |
TooManyTabs | A demonstration of the new tab wrapping property of JTabbedPane. | |
VBox | A quick test of the BoxLayout manager using the Box utility class. This box is laid out vertically. | |
Chapter 12 | ||
Class | Description | Source |
AccessoryFileChooser | An example of the JFileChooser class in action with an accessory. This accessory (see AudioAccessory.java) will play simple audio files within the file chooser. | |
AudioAccessory | An accessory for JFileChooser that lets you play music clips. Only the simple .au, .aiff and .wav formats available through the Applet sound classes can be played. | |
ColorPicker | A quick test of the JColorChooser dialog. | |
ColorPicker2 | A quick test of the JColorChooser dialog. This one installs the custom GrayScalePanel picker tab. | |
ColorPicker3 | A quick test of the JColorChooser dialog. This example adds a custom preview pane. | |
FontChooser | A font chooser that allows users to pick a font by name, size, style, and color. The color selection is provided by a JColorChooser pane. This dialog builds an AttributeSet suitable for use with JTextPane. | |
FontPicker | A quick test of the FontChooser dialog. (see FontChooser.java) | |
GrayScalePanel | A simple implementation of the AbstractColorChooserPanel class. This class provides a slider and a text field for picking out a shade of gray. | |
MyFilterChooser | Just a simple example to see what it takes to make one of these filters work. | |
MyViewChooser | An example that uses custom file views to show thumbnails of graphic files rather than the regular file icon. (see ThumbnailFileView.java) | |
SimpleFileChooser | A simple file chooser to see what it takes to make one of these work. | |
SimpleFileFilter | A straightforward extension-based example of a file filter. This should be replaced by a "first class" Swing class in a later release of Swing. | |
ThumbNailFileView | A simple implementation of the FileView class that provides a 16x16 image of each GIF or JPG file for its icon. This could be SLOW for large images, as we simply load the real image and then scale it. | |
Chapter 13 | ||
Class | Description | Source |
BevelExample | An example of borders with a BevelBorder used on JLabels as a highlight as the mouse rolls over them. | |
CurvedBorder | A custom border that draws round rectangle borders. | |
CurvedExample | A quick program to demonstrate the custom CurvedBorder class. (see CurvedBorder.java) | |
MatteExample | An example of the MatteBorder class. | |
RoundedLineBorder | A simple demontstration of the LineBorder class built with rounded corners. | |
TitledExample | An example of using a titled border on a label. | |
Chapter 14 | ||
Class | Description | Source |
CheckBoxMenuItemExample | A quick demonstration of checkbox menu items. | |
IntroExample | An introduction to building menus and menu items. Accelerators and mnemonics are added to various items. | |
MenuElementExample | An example of the JPopupMenu in action. | |
MenuExample | A simple example of constructing and using menus. | |
PopupMenuExample | A simple example of JPopupMenu. (See MenuElementExample.java for another.) | |
RadioButtonMenuItemExample | An example of radio button menu items in action. | |
SeparatorExample | A quick demonstration of the JSeparator() component used in a toolbar-like container. | |
ToolBarExample | An example of JToolBar. The actions used to build the toolbar are also placed in a JMenu to further demonstrate the flexibility of the Action class. (See the examples in Chapter 3 for more details on Action.) | |
Chapter 15 | ||
Class | Description | Source |
BigRenderer | A renderer for numbers that shows an icon in front of big numbers. | |
ColorTable | A table that allows the user to pick a color from a pulldown list. This is accomplished by using the DefaultCellRenderer and DefaultCellEditor classes. | |
ColumnExample | A test of JTable with a custom column model. The model used is a sorting model that keeps columns in alphabetical order. (see SortingColumnModel.java) | |
DatabaseTest | Let's try to make one of these databases work with a JTable for ouptut. | |
FileModel | A custom table model to display information on a directory of files. | |
FileTable | A test frame for the custom table model, FileModel. | |
FileTable2 | A test frame for the custom table model, FileModel. This version uses a custom renderer (BigRenderer.java) to flag large files with an exclamation point icon. | |
MYOSM | Make Your Own Stock Market: A simple stock market simulator that contains a few stocks and their current prices (and deltas). It randomly adjusts the prices on stocks to give a dynamic feel to the data. | |
MarketDataModel | A custom table model for use with the MYOSM environment. | |
MarketTable | An application that displays stock market data in a JTable. The table uses the MarketDataModel class for its model. MYOSM should be running to make the data dynamic. | |
QueryTableModel | A basic implementation of the TableModel interface that fills out a Vector of String[] structures from a query's result set. | |
SelectionExample | A simple multiplication table with the ability to play with row and column selections. You can alter the cell, column and row selection properties of the table at runtime. | |
SimpleTable | A test of the JTable class using default table models and a convenience constructor. | |
SortingColumnModel | A simple extension of the DefaultTableColumnModel class that sorts incoming columns alphabetically. This version is case-sensitive. | |
Stock | A simple aggregate class for storing stock market information on a single stock (symbol, price, etc.). | |
TableFeature | A test of the JTable class using default table models and a convenience constructor. Resizing and selection defaults are altered. | |
Chapter 16 | ||
Class | Description | Source |
ArrowIcon | A simple implementation of the Icon interface that can make Up and Down arrows. | |
ChartPainter | A simple chart-drawing UI base class. This class tracks the basic fonts and colors for various types of charts including pie and bar. The paint() method is abstract and must be implemented by subclasses for each type. | |
ChartTester | A test harness for the various table charting classes. (see ChartPainter.java, PieChartPainter.java, TableChart.java and TableChartPopup.java) | |
MixerModel | An audio mixer table data model. This model contains the following columns: + Track name (String) + Track start time (String) + Track stop time (String) + Left channel volume (Volume, 0 . . 100) + Right channel volume (Volume, 0 . . 100) |
|
MixerTest | A test application for showing Volume data in a JTable using the custom VolumneRenderer class. | |
MixerTest2 | A test of the MixerModel and sliders for rendering volume values. This version also includes adjustable sliders for editing the volume values. | |
PagingModel | A larger table model that performs "paging" of its data. This model reports a small number of rows (like 100 or so) as a "page" of data. You can switch pages to view all of the rows as needed using the pageDown() and pageUp() methods. Presumably, access to the other pages of data is dictated by other GUI elements such as up/down buttons, or maybe a text field that allows you to enter the page number you want to display. | |
PagingTester | A quick application that demonstrates the PagingModel. | |
PagingTester2 | A quick application that demonstrates the PagingModel. This version has an input field for dynamically altering the size of a page. | |
PieChartPainter | A pie chart implementation of the ChartPainter class. | |
Record | A simple data structure for use with the PagingModel demo. | |
RowHeaderTable | A simple application that demonstrates the use of the TableColumnModel class to build a row header column that scrolls with the regular data rows. | |
TableChart | A chart-generating class that uses the TableModel interface to get its data. | |
TableChartPopup | A popup framework for showing a chart of table data. This class also turns on tooltips for the chart. | |
Volume | A simple data structure for managing volumes on a mixer. | |
VolumeEditor | A slider Editor for volume values in a table. | |
VolumeRenderer | A slider renderer for volume values in a table. | |
Chapter 17 | ||
Class | Description | Source |
EditorComboBox | A CellEditor JComboBox subclass for use with Trees (and possibly tables). This version will work with any list of values passed as an Object[]. | |
EmailEditor | An extension of JTextField that requires an "@" somewhere in the field. Meant to be used as a cell editor within a JTable or JTree. | |
EmailTree | A simple test to see how we can build a tree and populate it. This application also uses custom renderers and editors. | |
EmailTreeCellEditor | An editor that actually manages two separate editors: one for folders (nodes) that uses a combo box; and one for files (leaves) that uses a text field. | |
IconAndTipCarrier | A simple interface that can be used with IconAndTipRenderer tree cell renderer. | |
IconAndTipRenderer | A renderer for our tree cells that have icons and tooltips. | |
ObjectTree | A simple test to see how we can build a tree and populate it. This version builds the tree from hashtables. | |
SortTreeDemo | This class creates a tree model using the SortTreeModel with a File hierarchy as input. | |
SortTreeModel | This class is similar to the DefaultTreeModel, but it keeps a node's children in alphabetical order. | |
TestTree | A simple test to see how we can build a tree and populate it. We build the tree structure up by hand in this case. | |
TestTree3 | A variation on TestTree that installs custom icons. The icons installed will appear on *every* tree. | |
TestTree4 | Another test to see how we can build a tree and customize its icons. This example does not affect the icons of other trees. | |
TreeEvents | An example of using EEL to show off all the events coming from a tree. You can add and remove nodes and watch for TreeModelEvents as well. | |
TreeStringComparator | This class compares the contents of the userObject as strings. It's case-insensitive. | |
VSX | A simple XML parser that builds a tree from SAX events. The xml file should be passed as a command line argument. | |
VSX2 | VSX2: A reasonably simple XML utility class. This class has two main methods: parse() and write(). Both work with the TreeModel class and are meant to help you view XML documents with JTree. This version will embed icons and tooltip text in nodes if icon or tiptext attributes are found in the tag. |
|
Chapter 18 | ||
Class | Description | Source |
ExtendedUndoManager | An extension of UndoManager that provides two additional features: (1) The ability to add & remove listeners and (2) the ability to gain more extensive access to the edits being managed. | |
SampleUndoableEdit | An example of an undoable edit. Used with the UndoManagerDetails class. | |
UndoManagerDetails | An example that shows lots of little UndoManager details | |
UndoableJToggleButton | Sample undoable toggle button class. Supports only a single listener to simplify the code. | |
UndoableJToggleButton2 | Sample undoable toggle button class using UndoableEditSupport. | |
UndoableToggleApp | A sample app showing the use of UndoableToggleEdit. | |
UndoableToggleApp2 | A sample app showing the use of UndoableToggleEdit and CompoundEdit. | |
UndoableToggleApp3 | A sample app showing the use of UndoManager. | |
UndoableToggleApp4 | A sample app showing the use of StateEdit(able). | |
UndoableToggleEdit | An UndoableEdit used to undo the pressing of a JToggleButton. | |
Chapter 19 | ||
Class | Description | Source |
JTextFieldExample | An example of setting up a text field and modifying its horizontal alignment at runtime. | |
OffsetTest | Show line start/end offsets in a JTextArea. | |
TextComponentSampler | An example of several text components including password fields and formatted fields. | |
TextForm | A simple label/field form panel | |
WidthHack | A hack to make a JTextField _really_ 2 columns wide | |
Chapter 20 | ||
Class | Description | Source |
CombinationFormatter | Input: string of form "15-45-22" (any number of hyphen-delimeted numbers) Output: int array |
|
FactoryDemo | Demo 1: field with different formats with focus and without. Demo 2: Change the format of a field when the user presses a button. |
|
FtfInputVerifier | An example of using an InputVerifier with a formatted text field. | |
RegexPatternFormatter | A formatter for regular expressions to be used with JFormattedTextField. | |
SimpleFTF | A quick demonstration of JFormattedTextField. | |
Chapter 21 | ||
Class | Description | Source |
CornerCaret | A custom caret class. | |
FancyCaret | Another (fancier) custom caret class. | |
KeymapExample | A simple example showing how to add Actions for KeyStrokes. | |
LineHighlightPainter | An implementation of HighlightPainter that underlines text with a thick line. | |
MultiHighlight | An example of highlighting multiple, discontiguous regions of a text component. | |
Chapter 22 | ||
Class | Description | Source |
ColorPane | A simple extension of JTextPane that allows the user to easily append colored text to the document. | |
LiveParenMatcher | Like ParenMatcher but continuously colors as the user edits the document. | |
MaxLengthDocument | An extension of PlainDocument that restricts the length of its content. | |
PaneInsertionMethods | Show how Icons, Components, and text can be added to a JTextPane. | |
ParenMatcher | A simple parenthesis matcher. | |
StyleBox | A control panel that can be used to edit a style's paragraph attributes. | |
StyleFrame | A JTextPane with a menu for Style manipulation. | |
TabExample | Demonstrate a TabSet in a JTextPane. | |
UndoStyleFrame | Add undo support to the StyleFrame example. This example only retains the most recent edit, to keep things simple. | |
UpcaseFilter | A simple DocumentFilter that maps lowercase letters to uppercase. | |
Chapter 23 | ||
Class | Description | Source |
DebugHTMLEditorKit | A simple extension of the HTMLEditor kit that uses a verbose ViewFactory. | |
HTMLEditor | An extension of StyledEditor that adds HTML-related features. | |
HTMLExample | A very simple browser using the basic HTML support built into JEditorPane. | |
IOStyledEditor | An extension of StyledEditor that adds document serialization. | |
MiniBrowser | Another implementation of a minimal browser. This one is tracks mouseover events on hyperlinks and shows the destination of the link in a status bar at the bottom of the window. | |
SimpleEditor | An example showing several DefaultEditorKit features. This class is designed to be easily extended for additional functionality. | |
SimpleLinkListener | A hyperlink listener for use with JEditorPane. This listener changes the cursor over hyperlinks based on enter/exit events and also loads a new page when a valid hyperlink is clicked. | |
StyledEditor | An extension of SimpleEditor that adds styled-text features. | |
StyledEditor2 | An extension of SimpleEditor that adds styled-text features. This version also adds the ability to save a styled document as an HTML file. | |
TextActionExample | A simple TextAction example. | |
Chapter 24 | ||
Class | Description | Source |
DragTest | A test of the DragSource classes to see if we can create a draggable object in a Java application. This version works with 1.3 and higher SDKs. | |
DragTest14 | A test of the drag capabilities built into the JDK 1.4. | |
DropTest | A simple drag & drop tester application. | |
DropTest14 | A simple drop tester application for JDK 1.4 Swing components. | |
DropTest2 | Another simple drag & drop tester application. | |
FSTest | A quick test environment for the FSTree component. | |
FSTree | A sample component for dragging & dropping a collection of files into a tree. | |
GestureTest | A test of the DragGesture classes to see if we can recognize a simple drag gesture. | |
TransferableTreeNode | A Transferable TreePath to be used with Drag & Drop applications. | |
TreeDragSource | A drag source wrapper for a JTree. This class can be used to make a rearrangeable DnD tree with the TransferableTreeNode class as the transfer data type. | |
TreeDragTest | A simple starting point for testing the DnD JTree code. | |
TreeDropTarget | A quick DropTarget that's looking for drops from draggable JTrees. | |
UTest | A test framework for the UberHandler drop handler. This version has no fancy Unicode characters for ease of use. (Note that "ease of use" only applies to humans...the Java tools are quite happy with Unicode characters. Not all text editors are, though...) | |
UberHandler | A TransferHandler that will accept any drop at all. If a text area is registered, debugging information will be sent there. Otherwise, all debug information will be sent to stdout. | |
Chapter 25 | ||
Class | Description | Source |
ActionExample | An example of getting the Accessible information from a Button object. (You could see this information by attaching an AssistiveExample object to the button. See BigExample.java for an example of that attachment.) | |
AssistiveExample | A GUI to show accessible information coming from the components in an application. See BigExample.java for example of how to use this class. | |
BigExample | A quick (contrived) application to create some accessible components for viewing through the AssistiveExample GUI. | |
Chapter 26 | ||
Class | Description | Source |
MetalModExample | An example of modifying an existing L&F. This example replaces the standard scrollbar UI with a custom version. | |
MyMetalScrollBarUI | A simple extension of MetalScrollBarUI that draws the thumb as a solid black rectangle. | |
RedTheme | A "Mars" theme for Metal. All of the primary colors used by Metal are set to shades of red. | |
ResourceModExample | An example of using UIManager resources to tweak the look of applications. | |
StdOutButtonUI | An alternate button resource that dumps accessibility information when it gains or loses focus. | |
StdOutLookAndFeel | A *simple* L&F that puts our StdOutButton to work. UIs for all the other components would be needed to make this L&F truly functional. | |
UIManagerDefaults | An informational utility to print the various UIManager defaults. | |
Chapter 27 | ||
Class | Description | Source |
ClockLabel | An extension of the JLabel class that listens to events from a Timer object to update itself with the current date & time. | |
ClockTest | A demonstration framework for the Timer driven ClockLabel class | |
SecretLabel | An extension of the JLabel class that listens to mouse clicks and converts them to ActionEvents, which in turn are reported via an EventListenersList object | |
SecretTest | A demonstration framework for the EventListenerList-enabled SecretLabel class | |
Chapter 28 | ||
Class | Description | Source |
AlphaButtonPolicy | A custom focus traversal policy that uses alphabetical ordering of button labels to determine "next" and "previous" buttons for keyboard traversal. | |
BasicJogShuttleUI | A UI class for our custom JogShuttle component. | |
FocusExample | An example of focus traversal using the keyboard to navigate through a small set of buttons. | |
FocusTraversalExample | Similar to the FocusExample, this class uses the custom AlphaButtonPolicy focus traversal policy to navigate another small set of buttons. | |
InvokeExample | This class demonstrates several examples of how to handle long-running tasks (such as querying a remote resource). Some of the examples are good, and some are not! | |
JogShuttle | A custom jog shuttle component. (Some VCRs have such a thing for doing variable speed fast-forward and fast-reverse.) An example of using the JogShuttle can be found in Sketch.java. | |
JogShuttleUI | Fill out the proper UIClassID information for our JogShuttle. | |
SimpleModel | An example of a custom data model that could be used in any MVC scenario. | |
SimpleModelInterface | An example of a data model interface that could be used in any MVC scenario. This interface is implemented in the SimpleModel class. | |
Sketch | A sketching application with two dials: one for horizontal movement, one for vertical movement. The dials are instances of the JogShuttle class. | |
Quartz 스케줄러 (0) | 2010.04.19 |
---|---|
GRIDBAGLAYOUT 사용하기 (1) | 2010.03.03 |
Swing 을 이용한 RAISON 담배~~~ (0) | 2010.02.28 |
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver 에러 (0) | 2010.02.24 |
초간단! TCP 를 이용한 서버의 시간 알아오는 프로그램 (0) | 2010.02.22 |