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 171979

Summary: [68cat] Toolbar IllegalComponentStateException
Product: platform Reporter: bruehlicke <bruehlicke>
Component: -- Other --Assignee: issues@platform <issues>
Status: NEW ---    
Severity: blocker    
Priority: P4    
Version: 6.x   
Hardware: PC   
OS: Solaris   
Issue Type: DEFECT Exception Reporter:
Attachments: Toolbar as in 6.5
Toolbar as in 6.8 with the 2-rows wide Icon space
double sized toolbar on 6.10-m1

Description bruehlicke 2009-09-10 22:30:19 UTC
[ BUILD # : 6.8 M1 ]
[ JDK VERSION : 1.6.* ]

I sent this to the Platform mailing list, but adding it here to be
captured. This one may be hard to re-produce.

Porting my app 6.8 M1 I got an issue with the toolbar now being 2
rows of icons. When drag&drop the "Cut&Paste" and then the
"Undo&Redo" toolbar to the upper row I got the following
IllegalComponentStateException - maybe it gives any a hint. I did
this
on a Solaris x86 box.


java.awt.IllegalComponentStateException: component must be showing on
the screen to determine its location
       at
java.awt.Component.getLocationOnScreen_NoTreeLock(Component.java:1943)

       at java.awt.Component.getLocationOnScreen(Component.java:1917)
       at
org.netbeans.core.windows.view.ui.toolbars.ToolbarConfiguration.maybeA
ddEmptyRow(ToolbarConfiguration.java:304)
       at
org.netbeans.core.windows.view.ui.toolbars.DnDSupport.dragMouseMoved(D
nDSupport.java:361)
       at
java.awt.dnd.DnDEventMulticaster.dragMouseMoved(DnDEventMulticaster.ja
va:107)
       at
java.awt.dnd.DnDEventMulticaster.dragMouseMoved(DnDEventMulticaster.ja
va:107)
       at
java.awt.dnd.DragSource.processDragMouseMoved(DragSource.java:761)
       at
java.awt.dnd.DragSourceContext.dragMouseMoved(DragSourceContext.java:4
15)
[catch] at
sun.awt.dnd.SunDragSourceContextPeer$EventDispatcher.run(SunDragSource
ContextPeer.java:428)
       at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
       at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
       at
org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.ja
va:117)
       at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThrea
d.java:269)
       at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.j
ava:184)
       at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThrea
d.java:174)
       at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
       at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
       at
java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Comment 1 bruehlicke 2009-09-11 14:33:21 UTC
Following was added by Tim Boudreau via the dev e-mail list:

"
Looks like a bug in the new implementation of toolbars in 6.7 - please file
it w/ exact steps to reproduce.

This sort of bug is fairly easy to cause - one mouse event handler removes
the event recipient from its parent, but does not consume the event;  the
next mouse event handler tries to do some innocuous thing that requires the
component bounds.  It's bewildering because the entire stack trace is often
inside Swing code (the offending call can sometimes be in a UI delegate or
similar) - these sorts of bugs also sometimes surface only when the look and
feel has been changed during runtime (UI delegate listeners are now called
*after* the program's listeners rather than *before*).

In this case, it looks like
org.netbeans.core.windows.view.ui.toolbars.DnDSupport.dragMouseMoved(DnDSupport.java:361)
should simply do something like
if (!((Component) evt.getSource()).isDisplayable()) {
  return;
}
to fix the problem.  isDisplayable() will return false if getParent() ==
null, so that should do the trick.
"


To reproduce I may be tricky, since it happens when I start my RCP app. I have my own drop-down action icon added to the
toolbar and when the RCP app starts the toolbar is 2 icons wide. The "Cut&Past" and the "Undo&Redo" toolbars are at the
second row. The error happened when I dragged the "Cut&Past" up to the upper row and then when I dragged the "Undo&Redo"
up -> Error. That was also the ;ast toolbars in the second row when it happened.
Comment 2 bruehlicke 2009-09-11 14:36:20 UTC
Created attachment 87505 [details]
Toolbar as in 6.5
Comment 3 bruehlicke 2009-09-11 14:37:01 UTC
Created attachment 87506 [details]
Toolbar as in 6.8 with the 2-rows wide Icon space
Comment 4 bruehlicke 2010-08-27 21:09:10 UTC
Created attachment 101725 [details]
double sized toolbar on 6.10-m1
Comment 5 bruehlicke 2010-08-27 21:15:42 UTC
I have just attached this double sized toolbar issue as I see it on the latest 6.10-m1 build. If you have any ideas what may be causing this please let me know. This is happening when I launch my app. It is working fine on 6.5. It was introduced in 6.7, was still there in 6,8 and 6.9 and now also in 6.10.

Workaround:  Drag all toolbars to the 2nd row and the first row will go away resulting in the usual one-row toolbar list. .. strange ... 

Anyhow - thanx for the upcoming 6.10 release - this is looking very promising