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 23072 - Setting component border to null causes an Exception when switching L&F
Summary: Setting component border to null causes an Exception when switching L&F
Status: VERIFIED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: Tomas Pavek
URL:
Keywords: L&F
Depends on:
Blocks:
 
Reported: 2002-05-03 00:09 UTC by Steve Benigan
Modified: 2005-07-11 12:49 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Benigan 2002-05-03 00:09:38 UTC
Setting a component border to null in the form editor and 
then restarting the IDE with a different look and feel 
results in the exception below.

I believe it's related to the following bug parade bugs:
http://developer.java.sun.com/developer/bugParade/bugs/4264
798.html
http://developer.java.sun.com/developer/bugParade/bugs/4192
869.html

I suggest that the user be warned of the issue either when 
saving a form with setBorder(null) or when loading a form 
that has setBorder(null) and recommend that they use 
setBorder to an EmptyBorder with 0,0,0,0 as insets.  
Otherwise, the user will be frustrated by having to remove 
the borders each time, not knowing that EmptyBorders 
should be used instead of null.  At the very least, that 
Annotation in the log should suggest using EmptyBorder 
instead.

From ide.log:
Annotation: Error in loading component property:
[JFrame]->jButton1->border
Cannot read the property value.
Annotation: Invalid format: missing border data.
java.io.IOException: Missing border data
        at 
org.netbeans.modules.form.editors2.BorderEditor.readFromXML
(BorderEditor.java:542)
        at 
org.netbeans.modules.form.GandalfPersistenceManager.loadCom
ponentProperties(GandalfPersistenceManager.java:1734)
        at 
org.netbeans.modules.form.GandalfPersistenceManager.loadCom
ponent(GandalfPersistenceManager.java:535)
        at 
org.netbeans.modules.form.GandalfPersistenceManager.restore
Component(GandalfPersistenceManager.java:507)
        at 
org.netbeans.modules.form.GandalfPersistenceManager.loadCom
ponent(GandalfPersistenceManager.java:629)
        at 
org.netbeans.modules.form.GandalfPersistenceManager.loadFor
m(GandalfPersistenceManager.java:361)
        at 
org.netbeans.modules.form.FormEditorSupport.loadFormData
(FormEditorSupport.java:520)
        at 
org.netbeans.modules.form.FormEditorSupport.access$000
(FormEditorSupport.java:38)
        at 
org.netbeans.modules.form.FormEditorSupport$1.run
(FormEditorSupport.java:113)
        at java.awt.event.InvocationEvent.dispatch
(InvocationEvent.java:178)
[catch] at java.awt.EventQueue.dispatchEvent
(EventQueue.java:443)
        at 
java.awt.EventDispatchThread.pumpOneEventForHierarchy
(EventDispatchThread.java:190)
        at 
java.awt.EventDispatchThread.pumpEventsForHierarchy
(EventDispatchThread.java:144)
        at java.awt.EventDispatchThread.pumpEvents
(EventDispatchThread.java:138)
        at java.awt.EventDispatchThread.pumpEvents
(EventDispatchThread.java:130)
        at java.awt.EventDispatchThread.run
(EventDispatchThread.java:98)
Comment 1 Tomas Pavek 2002-05-03 11:06:28 UTC
The exception is caused by a bug in Border Editor, I'll 
fix it. The result of this bug is that the null border is 
not correctly restored - and not set. So how do you know 
it cuases problems with some look and feels?

Anyway, form editor is a general tool working with beans. 
The fact that *some* property of *some* component when set 
to null (which is otherwise legal value) can cause 
problems on *some* configuration (becuase of some bug 
somwhere ;) is too specific - it is simply not a matter of 
form editor. Can you imagine how many different warnings 
we could display? We have just enough various hidden 
workarounds and hacks already now...
Comment 2 Tomas Pavek 2002-05-03 15:32:50 UTC
Fixed reading null border.
Comment 3 Steve Benigan 2002-05-06 00:59:11 UTC
How do I know it causes problems with different l&f's?  
Well, I tried it.

Putting in a warning under some circumstances would be 
important if it happens a lot.  I suspect that not many 
people are using the form editor in the first place b/c 
it's too hard to use and has bugs.  I'm trying to help you 
guys out by reporting what I have experienced since the 
days of Xelfi.  Having to fix borders every time I tested 
in another L&F was very problematic.  I'm not the only one 
who noticed this.  Over the years, a few people have 
mentioned it.  I think I'm the only person to report it.
Comment 4 Marek Grummich 2005-07-11 12:49:52 UTC
Verified