Introduction
These exercises show how to use Java's Swing components to interact with Java forms and windows.
There are seven exercises to complete:
- Installation and SwingSet Demonstration
Install Swing and demonstrate the SwingSet examples.
Educational goal(s):
- See the different Swing components in action
- A First JFC Application
Create a simple application with a Frame and a few Swing buttons.
Educational goal(s):
- Setup the environment to compile and run Swing programs
- Examine basic Swing Frame-based application
- Learn that Swing components can be used just like AWT components
- Use JDK 1.1 events to respond to button presses
- Buttons With Icons
Create image buttons with keyboard accelerators.
Educational goal(s):
- Learn to use an Icon as a JButton label
- Learn to use keyboard accelerators with buttons
- Use JDK 1.1 events to respond to button presses
- Add components to a JFrame
- Using Borders
Change the default border around a JButton and create your own dashed border.
Educational goal(s):
- Learn about the com.sun.java.swing.border package
- Learn to change a button's border
- Learn to create your own borders
- Using Toggles
Create a program to demonstrate checkboxes and radio buttons.
Educational goal(s):
- Learn about the JCheckbox class
- Learn about the JRadioButton class
- Learn about using icons with your checkboxes
- Learn about the JScrollPane class
- Using Menus, Toolbars, and Tool Tips
Setup the menus, toolbar, and toolbar tool tips for a simple text editor.
Educational goal(s):
- Learn about JMenu, JMenuItem, and JMenuBar
- Learn how to work with JToolBar and tool tips
- Learn about the JDialog class
- Using BoxLayout
Create an application using the BoxLayout layout manager.
Educational goal(s):
- Learn about the Box class
- Learn about the BoxLayout class ("glue" and
"struts") and how to use it for simple layouts
- Learn about using animated ImageIcon objects
|