Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 366824 - Eclipse freezes during the access to an exposed JList inside a JScrollPane
Summary: Eclipse freezes during the access to an exposed JList inside a JScrollPane
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: WindowBuilder (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Konstantin Scheglov CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-15 11:03 EST by Georg Konwisser CLA
Modified: 2021-06-04 16:45 EDT (History)
2 users (show)

See Also:


Attachments
3 Minimalized classes that produce the error (2.35 KB, text/plain)
2011-12-15 11:09 EST, Georg Konwisser CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Georg Konwisser CLA 2011-12-15 11:03:27 EST
Build Identifier: 20110916-0149

Everytime I use GridBagLayout and expose a JList inside a JScrollPane (let's say in class ParentPanel), other visual classes that try to access to this exposed JList cause a total hanging/freeze/crash of my whole Eclipse (it is shown as "not reacting").

This happens to classes that use ParentPanel as well as to classes that inherit from ParentClass.

Reproducible: Always

Steps to Reproduce:
1. Create a JPanel-class (ParentPanel)
2. Create a JPanel-class (ChildPanel) and let it inherit from ParentPanel
3. Set the layout of ParentPanel to GridBagLayout
4. Add a JScrollPane to ParentPanel (in cell [0,0])
5. Add a JList inside the JScrollPane
6. Expose the JList
7. Open ChildPanel in design view
8. Click on the inherited widget ("getList()") in the "Components" box
Comment 1 Georg Konwisser CLA 2011-12-15 11:09:52 EST
Created attachment 208446 [details]
3 Minimalized classes that produce the error

ChildPanel inherits from ParentPanel, AccessingPanel just uses ParentPanel as a component - both produce the freeze/hanging behavior of Eclipse.

To reproduce the described error:
1. Copy these three classes into a Java Project
2. Open either ChildPanel or AccessingPanel in design view
3. Click on the exposed JList widget "getList()" in the "Components" box of design view
Comment 2 Georg Konwisser CLA 2011-12-15 11:41:55 EST
Found a WorkAround!!!

As described this error occurs during an access on an exposed JList which is inside a (not exposed!) JScrollPane. And that's the answer: you have to expose all the surrounding components as well!

In other cases, where I used components that have exposed buttons inside an internal JPanel, this error did also occur - until I exposed the internal JPanel which contained the buttons as well.

There is also a strange behaviour if you use components which expose JTextFields or JComboBoxes inside of internal JPanels (without exposing the internal JPanel) - it does not cause this massive freezing but it places the selection of these JTextFields and JComboBoxes wrong, after exposing the surrounding JPanel it places everything right again.
Comment 3 Konstantin Scheglov CLA 2011-12-29 14:26:48 EST
1. I don't see freeze, but I see exception, still not good.

2. I've fixed this in trunk. We actually should not manage JList exposed like this by GridBagLayout, because JList is not direct child of its parent, it is parent of internal JPanel. This feature was known long time ago in SWT, but now I've fixed it for Swing too.