This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
As you can see in the attached screenshot, when a read-only property is selected it is hard to read. The problem seems happens because what should be a label is in fact two labels with the same text written in different colors with an offset of one pixel horizontal and vertical. I think that it is much more readable if the string is simply drawn normally in dark gray on the dark blue background.
Created attachment 28065 [details] Screenshot
Reassigning to "core" for evaluation.
Passing to property sheet.
This bug applies only when following LAF is used: com.sun.java.swing.plaf.windows.WindowsLookAndFeel This is windows specific LAF - we cannot test that on a linux box ;-( Running on windows with different LAF works fine e.g. with -ui com.sun.java.swing.plaf.motif.MotifLookAndFeel in the conf file. It is not JDK specific, I have tried with JDK 1.5 and 1.6 - the result is still the same. I have been testing NB 5.0 - not sure whether it still applies in the trunk. Making it P4 since I have received a request to fix it. My problem is that I don't regularly work on a win machine and looking into the sources so far did not give me any clue as to what the problem might be.
Ok, I have found the problematic code: it is in com.sun.java.swing.plaf.windows.WindowsLabelUI.paintDisabledText. It draws the string twice, once with shadow color, second time with white. The fix might either alter the colors or ??? (proposals welcome).
it's probably a bug in jdk as i couldn't find any native application that draws 'shadow' for disabled labels on windows xp. on the other hand the shadow is being used by native applications on 'windows classic'. i don't think this is fixable in netbeans only - the shadow color is used both for unselected and selected items so there's no universal color that would hide the shadow in all cases.
The property sheet code itself is clearly fixable from NetBeans since nothing is forcing us to use JLabel in org.openide.explorer.propertysheet.RendererFactory.StringRenderer.noHtmlLabel There are several ways to fix it: a. Paint the text directly in the paint method of StringRenderer (of course if there is no HTML involved) b. Provide special UI class for our copy of JLabel via a call to setUI (on Windows only) c. ??? Any preference? Adding Tim on Cc since he wrote the classes ...
I have committed a fix to our private branch (based on release50). You can check the diff here: http://www.netbeans.org/source/browse/openide/explorer/src/org/openide/explorer/propertysheet/RendererFactory.java?r1=1.4&r2=1.4.12.1 Can anybody review the patch? It is rather longish but I was not able to come up with something shorter ;-(
Looks fine; you could maybe make it slightly shorter using HtmlRenderer.renderString() (which does pretty much what your code does), but it works either way and if you don't want HTML rendering it might not be good to use it.
Checking in RendererFactory.java; /cvs/openide/explorer/src/org/openide/explorer/propertysheet/RendererFactory.java,v <-- RendererFactory.java new revision: 1.11; previous revision: 1.10 done