|
Customizing Components in Java
An Introduction |
|
Prof. David Bernstein
|
| Computer Science Department |
| bernstdh@jmu.edu |
DefaultMetalTheme
setCurrentTheme method in
the MetalLookAndFeel class
PropertyChangeEvent is dispatched to
all registered PropertyChangeListeners
JTree.lineStyle:
JScrollBar.isFreeStanding:
Boolean.FALSE indicates that sides will
have an etched borders, Boolean.TRUE
indicates that only the top and left edges will have
etched borders)JSlider.isFilled:
Boolean.TRUE) or not
(Boolean.FALSE)JToolBar.isRollover:
Boolean.TRUE etched border is displayed
only when the mouse is within its bounds and no border otherwise.
If Boolean.FALSE, an etched border
is always displayedJInternalFrame.isPalette:
Boolean.TRUE, a thin border is used;
if Boolean.FALSE, a thicker border is used
JComponent creates a view, its
updateUI method is calledLookAndFeel class that are
used to "install" the view, the installBorder and
installColorsAndFont methodsupdateUI method it
is possible to swap borders, colors, and fonts
between components
JTextArea look like a JLabel
UIManager class has a static method
named addAuxiliaryLookAndFeel that allows you to
add to a multiplexing viewComponentUI) and an extension of
LookAndFeel that adds the
view to the "defaults"