开发者

How to move JPopup up to Glasspane

开发者 https://www.devze.com 2023-02-07 14:30 出处:网络
I am putting a combobox component on the glasspane for users to select from a list of items.When the drop down list is clicked though the JPopupMenu is hidden behind other parts of the component on th

I am putting a combobox component on the glasspane for users to select from a list of items. When the drop down list is clicked though the JPopupMenu is hidden behind other parts of the component on the glasspane since the popups are displayed on the LayeredPane.

I would like to find out how to make the popup display on the glasspane with the component. I have tried JPopupMenu.setDefaultLightWeightPopupEnabled(false) before the frame was initialized but it seems that makes the popup not display at all anywhere and I am not sure why.

Any advice on how to get the popup to display on the glasspane instead of the jlayeredpane would be helpful. I searched but most responses seem to related to pushing events down that are captured on the glasspane.

I am actually using a JideAutoCompletionComboBox which extends JComboBox.

Edit for question: I have a system wide (my app has a bunch of workspaces on tabs) popup type system. I would like to not use a Modal dialog for this and just use the glasspane. The component is basically for creating a message but one of the subcomponents is a combobox. Effectively you can think of the whole component l开发者_C百科ike a popup though, but using the glasspane.


I don't like little floating windows that users can screw up by pushing around.

JDialog dialog = new JDialog(...);
dialog.setUndecorated(true);
0

精彩评论

暂无评论...
验证码 换一张
取 消