|
Quick Lists
|
|
Bug ID:
|
4607364
|
|
Votes
|
3
|
|
Synopsis
|
Improve default L&F of Swing.
|
|
Category
|
java:classes_swing
|
|
Reported Against
|
1.4
, 1.3.1
, tiger
, merlin-beta3
|
|
Release Fixed
|
1.5(tiger)
|
|
State
|
10-Fix Delivered,
request for enhancement
|
|
Priority:
|
3-Medium
|
|
Related Bugs
|
4489822
,
4512801
,
4607495
,
4723743
,
4811063
,
4908751
|
|
Submit Date
|
13-DEC-2001
|
|
Description
|
Improve look and feel of Swing and enable third parties to provide customized
implementations that don't depend on implementation assumptions. A l&f aware
layout manager is also desirable.
======================================================================
|
|
Work Around
|
N/A
|
|
Evaluation
|
This feature has been added for Tiger release
======================================================================
The new look, aka ocean, will be on by default.
To get the old look either do -Dswing.metalTheme=steel, or programmaticaly do
MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
UIManager.setLookAndFeel(new MetalLookAndFeel());
Contrary to my comments this resulted in a handful of API changes:
Old look will be available with the system property swing.metalTheme=steel
Revise spec of javax.swing.AbstractButton#getDisabledIcon from:
/**
* Returns the icon used by the button when it's disabled.
* If no disabled icon has been set, the button constructs
* one from the default icon.
* <!-- PENDING(jeff): the disabled icon really should be created
* (if necessary) by the L&F.-->
*
* @return the <code>disabledIcon</code> property
* @see #getPressedIcon
* @see #setDisabledIcon
*/
public Icon getDisabledIcon();
/**
* Returns the icon used by the button when it's disabled.
* If no disabled icon has been set this will forward the call to
* the ui to construct an appropriate disabled Icon.
* <p>
* Some look and feels might not render the disabled Icon, in which
* case they will ignore this.
*
* @return the <code>disabledIcon</code> property
* @see #getPressedIcon
* @see #setDisabledIcon
* @see javax.swing.plaf.ButtonUI#getDisabledIcon
*/
public Icon getDisabledIcon();
Add the following new method to javax.swing.plaf.ButtonUI:
/**
* Returns the icon to display when the developer has not specified
* a disabled icon.
* <p>
* Some look and feels might not render the disabled Icon, in which
* case they will ignore this.
*
* @param button AbstractButton requesting the Icon
* @return Disabled icon, or null.
* @see javax.swing.AbstractButton#setIcon
* @see javax.swing.AbstractButton#setDisabledIcon
* @throws NullPointerException if <code>button</code> is null
* @since 1.5
*/
public Icon getDisabledIcon(AbstractButton button);
Add the following two overriden methods to javax.swing.plaf.metal.MetalCombBoxUI:
/**
* If necessary paints the currently selected item.
*
* @param g Graphics to paint to
* @param bounds Region to paint current value to
* @param hasFocus whether or not the JComboBox has focus
* @throws NullPointerException if any of the arguments are null.
* @since 1.5
*/
public void paintCurrentValue(Graphics g, Rectangle bounds,
boolean hasFocus);
/**
* If necessary paints the background of the currently selected item.
*
* @param g Graphics to paint to
* @param bounds Region to paint background to
* @param hasFocus whether or not the JComboBox has focus
* @throws NullPointerException if any of the arguments are null.
* @since 1.5
*/
public void paintCurrentValueBackground(Graphics g, Rectangle bounds,
boolean hasFocus);
Add the following two overriden methods to javax.swing.plaf.metal.MetalButtonUI:
/**
* If necessary paints the background of the component, then
* invokes <code>paint</code>.
*
* @param g Graphics to paint to
* @param c JComponent painting on
* @throws NullPointerException if <code>g</code> or <code>c</code> is
* null
* @see javax.swing.plaf.ComponentUI#update
* @see javax.swing.plaf.ComponentUI#paint
* @since 1.5
*/
public void update(Graphics g, JComponent c);
/**
* Returns the icon to display when the button is disabled.
*
* @param button AbstractButton requesting the Icon
* @return Disabled icon, or null.
* @see javax.swing.AbstractButton#setIcon
* @see javax.swing.AbstractButton#setDisabledIcon
* @throws NullPointerException if <code>button</code> is null
* @since 1.5
*/
public Icon getDisabledIcon(AbstractButton button);
Create the class javax.swing.plaf.metal.MetalMenuBarUI:
/**
* Metal implementation of <code>MenuBarUI</code>. This class is responsible
* for providing the metal look and feel for <code>JMenuBar</code>s.
*
* @see javax.swing.plaf.MenuBarUI
* @since 1.5
*/
public class MetalMenuBarUI extends BasicMenuBarUI {
/**
* Creates the <code>ComponentUI</code> implementation for the passed
* in component.
*
* @param x JComponent to create the ComponentUI implementation for
* @return ComponentUI implementation for <code>x</code>
* @throws NullPointerException if <code>x</code> is null
*/
public static ComponentUI createUI(JComponent x);
/**
* Configures the specified component appropriate for the metal look and
* feel.
*
* @param c the component where this UI delegate is being installed
* @throws NullPointerException if <code>c</code> is null.
*/
public void installUI(JComponent c);
/**
* Reverses configuration which was done on the specified component during
* <code>installUI</code>.
*
* @param c the component where this UI delegate is being installed
* @throws NullPointerException if <code>c</code> is null.
*/
public void uninstallUI(JComponent c);
/**
* If necessary paints the background of the component, then
* invokes <code>paint</code>.
*
* @param g Graphics to paint to
* @param c JComponent painting on
* @throws NullPointerException if <code>g</code> or <code>c</code> is
* null
* @see javax.swing.plaf.ComponentUI#update
* @see javax.swing.plaf.ComponentUI#paint
* @since 1.5
*/
public void update(Graphics g, JComponent c);
}
Add the following overriden method to javax.swing.plaf.metal.MetalToolBarUI:
/**
* If necessary paints the background of the component, then invokes
* <code>paint</code>.
*
* @param g Graphics to paint to
* @param c JComponent painting on
* @throws NullPointerException if <code>g</code> or <code>c</code> is
* null
* @see javax.swing.plaf.ComponentUI#update
* @see javax.swing.plaf.ComponentUI#paint
* @since 1.5
*/
public void update(Graphics g, JComponent c);
Add the following overriden methods to javax.swing.plaf.metal.MetalToggleButtonUI:
/**
* If necessary paints the background of the component, then invokes
* <code>paint</code>.
*
* @param g Graphics to paint to
* @param c JComponent painting on
* @throws NullPointerException if <code>g</code> or <code>c</code> is
* null
* @see javax.swing.plaf.ComponentUI#update
* @see javax.swing.plaf.ComponentUI#paint
* @since 1.5
*/
public void update(Graphics g, JComponent c);
/**
* Paints the appropriate icon of the button <code>b</code> in the
* space <code>iconRect</code>.
*
* @param g Graphics to paint to
* @param b Button to render for
* @param iconRect space to render in
* @throws NullPointerException if any of the arguments are null.
* @since 1.5
*/
protected void paintIcon(Graphics g, AbstractButton b, Rectangle iconRect);
/**
* Returns the icon to display when the button is disabled.
*
* @param button AbstractButton requesting the Icon
* @return Disabled icon, or null.
* @see javax.swing.AbstractButton#setIcon
* @see javax.swing.AbstractButton#setDisabledIcon
* @throws NullPointerException if <code>button</code> is null
* @since 1.5
*/
public Icon getDisabledIcon(AbstractButton button);
xxxxx@xxxxx 2003-08-08
|
|
Comments
|
Submitted On 01-OCT-2004
ezfekgjhrcfz
I think the new metal theme is ugly. While not very sexy, the old one was consistent. The gradient blue of buttons is distracting to the eye. And so is the scroll bar's. The color of selected is very ugly too, since it's not the same panels inside them. And some panels now have a border so it kind of break the visual compatibility.
Submitted On 14-DEC-2004
madhavansree
Its a great work . Good to see this .
I appreciate all the Swing engineering team at SUN.
Keep up the good work .
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|
|
|
 |