-
Bug
-
Resolution: Won't Fix
-
P3
-
None
-
5.0u16
-
x86
-
linux_ubuntu
JCheckBox looks bad with some themes on Ubuntu.
This issue is originally reported against NetBeans Installer (which runs on Java):
http://www.netbeans.org/issues/show_bug.cgi?id=142650
It is broken with JDK5u16 and looks much better with OpenJDK6 and jdk 6u10.
It works fine with Metal and Nimbus but looks ugly with GTK L&F.
http://www.netbeans.org/nonav/issues/showattachment.cgi/67563/ScreenShots.zip
Tony (in CC) can give more info if required.
The source code of the demo used in the issue:
package jcheckboxcheck;
import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
public class Main {
public static void main(String[] args) {
String[] lafs = {"javax.swing.plaf.metal.MetalLookAndFeel",
"com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel",
"com.sun.java.swing.plaf.gtk.GTKLookAndFeel"
};
for (String laf : lafs) {
try {
UIManager.getInstalledLookAndFeels();
UIManager.setLookAndFeel(laf);
JCheckBox box = new JCheckBox();
JFrame theFrame = new JFrame("Label Test");
theFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
theFrame.setLayout(new GridBagLayout());
Container contentPane = theFrame.getContentPane();
contentPane.add(box, new GridBagConstraints(0,0,0,0,1,1,GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(11, 11, 0, 11), 0, 0));
theFrame.setSize(400, 100);
theFrame.setLocation(600, 400);
theFrame.setVisible(true);
box.setText("This is a long, long checkbox, try it, please");
try {
Thread.sleep(5000);
} catch (InterruptedException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
theFrame.setVisible(false);
} catch (ClassNotFoundException ex) {
} catch (InstantiationException ex) {
} catch (IllegalAccessException ex) {
} catch (UnsupportedLookAndFeelException ex) {
}
}
System.exit(0);
}
}
This issue is originally reported against NetBeans Installer (which runs on Java):
http://www.netbeans.org/issues/show_bug.cgi?id=142650
It is broken with JDK5u16 and looks much better with OpenJDK6 and jdk 6u10.
It works fine with Metal and Nimbus but looks ugly with GTK L&F.
http://www.netbeans.org/nonav/issues/showattachment.cgi/67563/ScreenShots.zip
Tony (in CC) can give more info if required.
The source code of the demo used in the issue:
package jcheckboxcheck;
import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
public class Main {
public static void main(String[] args) {
String[] lafs = {"javax.swing.plaf.metal.MetalLookAndFeel",
"com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel",
"com.sun.java.swing.plaf.gtk.GTKLookAndFeel"
};
for (String laf : lafs) {
try {
UIManager.getInstalledLookAndFeels();
UIManager.setLookAndFeel(laf);
JCheckBox box = new JCheckBox();
JFrame theFrame = new JFrame("Label Test");
theFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
theFrame.setLayout(new GridBagLayout());
Container contentPane = theFrame.getContentPane();
contentPane.add(box, new GridBagConstraints(0,0,0,0,1,1,GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(11, 11, 0, 11), 0, 0));
theFrame.setSize(400, 100);
theFrame.setLocation(600, 400);
theFrame.setVisible(true);
box.setText("This is a long, long checkbox, try it, please");
try {
Thread.sleep(5000);
} catch (InterruptedException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
theFrame.setVisible(false);
} catch (ClassNotFoundException ex) {
} catch (InstantiationException ex) {
} catch (IllegalAccessException ex) {
} catch (UnsupportedLookAndFeelException ex) {
}
}
System.exit(0);
}
}