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.

Bug 70791 - Read-only properties are hard to read when selected
Summary: Read-only properties are hard to read when selected
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Explorer (show other bugs)
Version: 5.x
Hardware: PC Windows ME/2000
: P4 blocker (vote)
Assignee: David Strupl
URL:
Keywords: L&F
Depends on:
Blocks:
 
Reported: 2005-12-25 23:35 UTC by ngbrito
Modified: 2008-12-22 11:33 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot (6.67 KB, application/x-compressed)
2005-12-25 23:36 UTC, ngbrito
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ngbrito 2005-12-25 23:35:49 UTC
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.
Comment 1 ngbrito 2005-12-25 23:36:22 UTC
Created attachment 28065 [details]
Screenshot
Comment 2 Peter Pis 2005-12-29 21:14:28 UTC
Reassigning to "core" for evaluation.
Comment 3 David Simonek 2006-08-08 16:58:07 UTC
Passing to property sheet.
Comment 4 David Strupl 2007-04-25 12:25:59 UTC
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.
Comment 5 David Strupl 2007-04-25 12:48:57 UTC
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).
Comment 6 Stanislav Aubrecht 2007-04-25 15:02:16 UTC
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.
Comment 7 David Strupl 2007-04-25 16:55:36 UTC
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 ...
Comment 8 David Strupl 2007-04-27 21:20:26 UTC
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 ;-(
Comment 9 _ tboudreau 2007-04-28 14:30:22 UTC
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.
Comment 10 David Strupl 2007-05-08 20:19:32 UTC
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