aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Prevent hide popup menu Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Prevent hide popup menu" Watch "Prevent hide popup menu" New topic
Author

Prevent hide popup menu

deep pat
Greenhorn

Joined: Oct 10, 2009
Posts: 4
Hi all,
I've created a popup menu with comboboxes which is brought forward upon a button click. I would like to prevent it from hiding when i check or on check combobox(es).

Please give me an advice coz for the moment my popup menu disappears each time i check/uncheck a combo.

I also tried the trick found at another forum

But it's not working.

Thanks in advance
Brian Cole
Author
Ranch Hand

Joined: Sep 20, 2005
Posts: 862
deep pat wrote:
I also tried the trick found at another forum
But it's not working.


Surely you mean someOtherThing.putClientProperty("doNotCancelPopup", preventHide) on line 3, no?


bitguru blog
deep pat
Greenhorn

Joined: Oct 10, 2009
Posts: 4

Surely you mean someOtherThing.putClientProperty("doNotCancelPopup", preventHide) on line 3, no?

Well, i really dont know, i tried using other things (the popup menu itself or the button which calls it) at line 3 but of no avail.

I saw the trick supposed to prevent the popup menu from hiding on this site.
webpage

As fact, I'm trying to create a JTable with a button on the top right of the scrollbar which opens a popup menu with comboboxes and table column names (As in JXTable but using JTable ). I have the desired result except the popup disappears each time i click on the combo.

I'm surely missing something but what?
Martin Lindgren
Greenhorn

Joined: Jul 02, 2012
Posts: 2
I am struggling with this issue as well. Does anyone have further advice on how to solve it? Did you solve it Deep pat? Not sure if you will notice this late bump but worth a shot ;-)
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4527
    
    5

Martin, welcome to the Ranch! To get better help sooner, post a SSCCE (Short, Self Contained, Correct (Compilable), Example) that demonstrates the problem (and don't forget to UseCodeTags <-- link ).


luck, db
There are no new questions, but there may be new answers.
Martin Lindgren
Greenhorn

Joined: Jul 02, 2012
Posts: 2
Thank you!

This little piece of code will explain my problem.


Click anywhere to make the popup window with the combobox appear. Then when clickin on the combobox, the actual popup disappears. After some research I thought I found a solution which was the one that Brian Cole mentioned:

But that didn't change anything.

Any suggestions? I know that one solution is to skip the popup frame and make a window instead, but that will need a lot of rework in the code
which I would rather not re-implement.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632


you'll have to work out what's best for you to dispose the popup

one way might be to add this to the frame's listener
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Prevent hide popup menu