JComboBox popup behind frame

Strange problem today : I have a JComboBox on a JInternalFrame. When I click the combo, the list gets displayed behind the frame. I can see a small part of the list below the frame, but the rest is hidden.I really dont know in which direction I should be looking. Any pointer ?
[291 byte] By [869709gehela] at [2007-11-26 12:18:18]
# 1
Make sure you are using all Swing components (no AWT).Also, create and post a simple example.
642814zadoka at 2007-7-7 14:57:40 > top of Java-index,Archived Forums,Socket Programming...
# 2

Only Swing components (as far as I can tell). I'm trying to get used to the code myself (I'm new on this project).

I'll work on an example tonight. Basically, we are trying to get a modal JInternalFrame. For that, we create a non-opaque glass pane on the JFrame that captures all mouse events. Then we create a JInternalFrame inside of that. This JInternalFrame acts as a modal frame because no other frames can get the focus. But the JComboBox inside that JInternalFrame has its popup behind the glassPane ...

869709gehela at 2007-7-7 14:57:40 > top of Java-index,Archived Forums,Socket Programming...
# 3

Well, yes, the glass pane sits over the layered pane (which contains the popup layer used by the combo dropdown) - so if you place components directly into that then all the others will be behind them.

I expect this explains it in more detail,

http://java.sun.com/docs/books/tutorial/uiswing/components/rootpane.html

551768itchyscratchya at 2007-7-7 14:57:40 > top of Java-index,Archived Forums,Socket Programming...
# 4
It sounds obvious once you know it. Thanks for your help !So I guess I'll have to find another way to get my modal InternalFrame ...
869709gehela at 2007-7-7 14:57:40 > top of Java-index,Archived Forums,Socket Programming...
# 5
The best way to do it would be to extend BasicDesktopPaneUI and override installDesktopManager() to supply a specialization of DefaultDesktopManager, which is the strategy for defining your own frame management behaviour.
551768itchyscratchya at 2007-7-7 14:57:40 > top of Java-index,Archived Forums,Socket Programming...
# 6
I think that actually the best way would be to use a JDialog to implement a modal dialog (which is exactly what we want to do). I'll try to adapt our classes tomorow.Thanks a lot for your help !
869709gehela at 2007-7-7 14:57:40 > top of Java-index,Archived Forums,Socket Programming...
# 7
It's certainly the normal way to do modal dialogs ;o)Don't forget about the JOptionPane class too, which helps you with modal dialogs.
551768itchyscratchya at 2007-7-7 14:57:40 > top of Java-index,Archived Forums,Socket Programming...