JDK-6388598 : Win XP JButtons on a JToolBar have extra empty space
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2006-02-22
  • Updated: 2010-04-03
  • Resolved: 2006-02-22
Related Reports
Duplicate :  
Description
A DESCRIPTION OF THE REGRESSION :
The JButtons on a JToolbar have extra empty space to the left and right when running with the Windows XP look and feel on Mustang.  When running on Java 5 there is no extra space to the sides of the buttons and they look like proper toolbar buttons.

REPRODUCIBLE TESTCASE OR STEPS TO REPRODUCE:
/*
 * BadButtons.java
 *
 * Created on February 16, 2006, 10:22 PM
 */

package toolbarregression;

import java.awt.BorderLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JToolBar;
import javax.swing.UIManager;

/**
 * @author Scott Palmer
 */
public class BadButtons
{
	public static void main(String[] args) throws Exception
	{
		UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		JFrame f = new JFrame("JToolBar+JButton Regression Demo Windows XP L&F");
		JToolBar tb = new JToolBar();
		tb.setFloatable(false);
		for(char c='A'; c < 'N';c++)
			tb.add(new JButton(String.valueOf(c)));
		f.getContentPane().add(tb,BorderLayout.NORTH);
		f.getContentPane().add(new JLabel("<html>The tool bar buttons above are too wide when running on Mustang.<br>Run this application on Windows XP as the Windows XP Look and Feel is required.</html>"),BorderLayout.CENTER);
		f.pack();
		f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		f.setVisible(true);
	}
}


RELEASE LAST WORKED:
5.0 Update 6

RELEASE TEST FAILS:
mustang-b70

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The buttons on the tool bar should not have the extra margin on the left and right but should be more "square" like they are with Java 5.
ACTUAL -
The JButtons are not treated like they are on a JToolBar and appear with extra space to the left and right of the button's icon and/or text inside the button border.

APPLICATION NAME: Digital Rapids Stream	APPLICATION VERSION: 2.1.1

OBSERVED APPLICATION IMPACT:
The significant extra space used by the toolbar buttons the toolbars tool large to fit within the application window.  That can lead to some functions being inaccessible.

It also simply looks ugly.

Comments
EVALUATION Duplicate of 6349010. Work in progress.
22-02-2006