JDK-6390265 : Swing Disabled JButton(s)
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2006-02-24
  • Updated: 2010-04-03
  • Resolved: 2006-03-02
Related Reports
Duplicate :  
Description
A DESCRIPTION OF THE REGRESSION :
Swing JButton(s) when setEnabled(false) under Windows XP with the Royale theme don't render correctly.

REPRODUCIBLE TESTCASE OR STEPS TO REPRODUCE:
/*
 * RegressionFrame.java
 *
 * Created on February 18, 2006, 5:35 PM
 */

package regressiontest;

/**
 *
 * @author  Daniel Spiewak
 */
public class RegressionFrame extends javax.swing.JFrame {
	
	/** Creates new form RegressionFrame */
	public RegressionFrame() {
		initComponents();
	}
	
	/** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
    private void initComponents() {
        jLabel1 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        jButton2 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        jLabel1.setText("This button works just fine:");

        jButton1.setText("Working Button");

        jLabel2.setText("This button doesn't work right:");

        jButton2.setText("Nonworking Button");
        jButton2.setEnabled(false);

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel1)
                    .add(jLabel2))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 101, Short.MAX_VALUE)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(jButton2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(jButton1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel1)
                    .add(jButton1))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel2)
                    .add(jButton2))
                .addContainerGap(40, Short.MAX_VALUE))
        );
        pack();
    }// </editor-fold>
	
	/**
	 * @param args the command line arguments
	 */
	public static void main(String args[]) {
		java.awt.EventQueue.invokeLater(new Runnable() {
			public void run() {
				new RegressionFrame().setVisible(true);
			}
		});
	}
	
    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    // End of variables declaration
	
}

RELEASE LAST WORKED:
5.0

RELEASE TEST FAILS:
mustang-b70

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The JButton should have been grayed out just as native buttons do or JButton(s) did in 5.0.
ACTUAL -
The JButton was whited out with a black, rectangular border.

APPLICATION NAME: Any swing app	APPLICATION VERSION: any

OBSERVED APPLICATION IMPACT:
Swing applications depend on fidelity to the platform, especially on Windows.  This is a breach in the fidelity and really anyone who codes in Swing would be effected.

Comments
EVALUATION This is the same as bug 6342546. It indicates that the root problem is more than just the one theme, but has to do with the way we load images. I'm marking it as a duplicate.
02-03-2006

EVALUATION I have emailed the original submitter for more information about the theme.
02-03-2006

EVALUATION There is no indication of that the Royale theme is or where we can get it. This is difficult to diagnose without the theme.
28-02-2006

EVALUATION The black border sounds like bug 6342546. We need to investigate whether the whited-out vs. greyed-out is the same issue.
28-02-2006