<Swing Dev> Bug in JLabel setForeground JDK 1.8.0_31
Christian Bürckert
Christian.Buerckert at dfki.de
Sun Mar 15 14:19:34 UTC 2015
Hi Support Team,
something seems to be wrong in the setForeground method of JLabel.
The following minimal example reproduces the error on my maschine.
As you can imagine a WHITE text is expected but as screenshot jdk8.png
shows it's actually black. After changing to jdk7 the same program
behaves like expected (see screenshot jdk7.png).
(Exact jdk versions see at the end of the e-mail)
public static void main(String[] args) throws Exception {
JFrame jframe = new JFrame();
jframe.setLayout(new FlowLayout());
JLabel test = new JLabel();
test.setText("This text should be white");
test.setForeground(Color.WHITE);
jframe.add(test);
jframe.pack();
jframe.setVisible(true);
System.out.println(test.getForeground());
}
java -version
openjdk version "1.8.0_31"
OpenJDK Runtime Environment (build 1.8.0_31-b13) OpenJDK 64-Bit Server
VM (build 25.31-b07, mixed mode)
java -version
java version "1.7.0_75"
OpenJDK Runtime Environment (IcedTea 2.5.4) (Arch Linux build
7.u75_2.5.4-1-x86_64)
OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode)
--
***********************************************
Christian Bürckert, M. Sc.
Junior Engineer at DFKI GmbH
Stuhlsatzenhausweg 3, 66123 Saarbrücken
Raum 1.79
Telefon (SB): +49(0)681 85775 5013
Telefon (WND): +49(0)6851 909 8101
e-mail: christian.buerckert at dfki.de
web: http://www.innovative-retail.de/
***********************************************
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Firmensitz: Trippstadter Strasse 122, D-67663 Kaiserslautern
Geschaeftsfuehrung:
Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster (Vorsitzender) Dr. Walter
Olthoff
Vorsitzender des Aufsichtsrats:
Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jdk7.png
Type: image/png
Size: 1821 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20150315/c684ccb0/jdk7.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jdk8.png
Type: image/png
Size: 2504 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20150315/c684ccb0/jdk8.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5932 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20150315/c684ccb0/smime.p7s>
More information about the swing-dev
mailing list