-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.2.0
-
None
-
generic
-
generic
Dragging a toolbar out and then closing the toolbar window (to set
the toolbar back in its original place) causes an IllegalArgumentException
if GridBagLayout is being used for the toolbar's container:
Exception occurred during event dispatching:
java.lang.IllegalArgumentException: cannot add to layout: constraint must be a GridBagConstraint
at java.awt.GridBagLayout.addLayoutComponent(GridBagLayout.java:450)
at java.awt.Container.addImpl(Container.java:313)
at java.awt.Container.add(Container.java:183)
at java.awt.swing.plaf.basic.BasicToolBarUI.setFloating(BasicToolBarUI.java:226)
at java.awt.swing.plaf.basic.BasicToolBarUI$FrameListener.windowClosing(BasicToolBarUI.java:424)
at java.awt.Window.processWindowEvent(Window.java:413)
at java.awt.swing.JFrame.processWindowEvent(JFrame.java:140)
at java.awt.Window.processEvent(Window.java:389)
at java.awt.Component.dispatchEventImpl(Component.java:2041)
at java.awt.Container.dispatchEventImpl(Container.java:912)
at java.awt.Window.dispatchEventImpl(Window.java:527)
at java.awt.Component.dispatchEvent(Component.java:1951)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:167)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:45)
To recreate, bring up the attached app.
This displays a JToolBar in a JFrame that uses a GridBagLayout.
Drag the toolbar out of the frame.
Close the toolbar window to set it back in its original place in the frame.
This causes an IllegalArgumentException to occur.
- duplicates
-
JDK-4107628 JToolBar docking on the sides works only if LayoutManager is BoderLayout.
- Closed