Introduction
These exercises show how to use various aspects of the Model-View-Controller (MVC) architecture of Swing.
It helps, considerably, if you have already completed the exercises from
Part I.
There are 4 exercises to complete:
- Tree Views
Create a hierarchy view of a few Java class names.
Educational goal(s):
- Learn about the JTree, TreeNode, and DefaultMutableTreeNode classes
- Listen for tree event types
- Examine the JScrollPane panel
- Custom JTree Rendering
Create a hierarchy view of a few Java class names and supply a custom node view.
Educational goal(s):
- Implement a custom TreeCellRenderer
- Using JTextPane
Work with the com.sun.java.swing.text package to support changing font style, color, size,
and family. Use the Swing Chooser classes.
Educational goal(s):
- Learn about JTextPane, DefaultStyledDocument, and Style
- Work with JColorChooser and JFileChooser
- Add icons to menu items
- Add icons to text panes
- Using Tables
Work with the com.sun.java.swing.table package to create a table with a custom cell renderer.
Educational goal(s):
- Learn about JTable, TableColumn, and TableCellRenderer
- Create a custom cell renderer for a table column
|