Created attachment 314921 [details] test program Description of problem: When using the GTL LookAndFeel, JTextPane.setBackground() is ignored. It worked with Sun Java 1.6.0_07-b06. I've attached a minimal example program which exhibits the problem. Version-Release number of selected component (if applicable): java-1.6.0-openjdk-1.6.0.0-0.16.b09.fc9.x86_64 How reproducible: Always. Steps to Reproduce: 1. javac Test.java 2. java Test 3. java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel Test Actual results: The first run of the test program will use the default Metal LookAndFeel. Both JVMs I've tested (1.6.0_07-b06, and OpenJDK 1.6.0-b09) give the expected result. The second run of the test program will use the GTK LookAndFeel. With Sun's 1.6.0_07-b06, I get the expected result, but with OpenJDK 1.6.0-b09 the text has a white background while the surrounding panel has a grey background. Expected results: The background of the text should be the same color as the background of the surrounding panel. Additional info: I've yet to find a workaround for this, so it completely blocks me from using JTextPane. This used to work, and JTextPane.setForeground() works properly now and seems like it should work the same way as JTextPane.setBackground().
I've installed the OpenJDK packages from the Fedora 10 Beta (java-1.6.0-openjdk-1.6.0.0-0.20.b11.fc10.x86_64) and this problem is still present.
This problem is still present in java-1.6.0-openjdk-1.6.0.0-6.b12.fc10.x86_64 from Fedora 10.
Hi Joel, I posted the question to swing-dev: http://mail.openjdk.java.net/pipermail/swing-dev/2009-January/000366.html To summarize: when using the native look and feel (on any platform), the user's theme settings are used, and the programmer assignments are likely to be ignored. Please see the thread for details. Cheers
The way I found this bug is that I was subclassing JTextPane in order to get a label which would support both word wrap and full justification of text. So in this case, the correct background color is really not what the theme thinks should be the background color for a JTextPane, but rather what the theme thinks should be the background color for a JLabel. This kind of policy makes the uses to which components can be put very narrow if you're using a native L&F. To be clear: What I want to achieve is to have this component of mine to have the same background color as a JLabel, because it *is* functionally a JLabel, despite that it inherits from JTextPane. I'm not trying to circumvent the color scheme provided by the L&F here, I'm trying to follow it---so it's very disheartening to read the replies you received.
I appreciate your efforts in tracking down what the expected behavior is. If this is officially Not a Bug, how does one do what I'm trying to do?
(In reply to comment #5) > I appreciate your efforts in tracking down what the expected behavior is. If > this is officially Not a Bug, how does one do what I'm trying to do? I would suggest replying to the upstream thread and explaining what you want to do: http://thread.gmane.org/gmane.comp.java.openjdk.swing.devel/363
(In reply to comment #6) > (In reply to comment #5) > > I appreciate your efforts in tracking down what the expected behavior is. If > > this is officially Not a Bug, how does one do what I'm trying to do? > > I would suggest replying to the upstream thread and explaining what you want to > do: > http://thread.gmane.org/gmane.comp.java.openjdk.swing.devel/363 I tried, but was unable to get anyone on that list to offer an alternative way of specifying which role a component is carrying out so that it gets the right background color from the L&F. (In fact, there was one guy who seemed to agree with my original contention that this is a bug, if there's no alternative.)
This message is a reminder that Fedora 10 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 10. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '10'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 10's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 10 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
This message is a reminder that Fedora 11 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 11. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '11'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 11's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 11 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
This problem is still unresolved in Fedora 12.
Created attachment 447751 [details] a potential fix This is a quick-and-dirty patch that allows changing the background color of a JTextPane (and potentially other JComponents). However, I do not think IcedTea or Fedora will accept this patch until the OpenJDK developers are happy with it.
Still happens with java-1.6.0-openjdk-1.6.0.0-42.b18.fc13.x86_64. How do we impress on the OpenJDK devs that this matters?
Problem still happens in java-1.6.0-openjdk-1.6.0.0-42.b18.fc13.x86_64. What do we need to do to get the OpenJDK devs to recognize that this is a problem?
This message is a reminder that Fedora 13 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 13. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '13'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 13's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 13 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
This message is a notice that Fedora 15 is now at end of life. Fedora has stopped maintaining and issuing updates for Fedora 15. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At this time, all open bugs with a Fedora 'version' of '15' have been closed as WONTFIX. (Please note: Our normal process is to give advanced warning of this occurring, but we forgot to do that. A thousand apologies.) Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, feel free to reopen this bug and simply change the 'version' to a later Fedora version. Bug Reporter: Thank you for reporting this issue and we are sorry that we were unable to fix it before Fedora 15 reached end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged to click on "Clone This Bug" (top right of this page) and open it against that version of Fedora. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping