 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Nicky Guest
|
Posted: Wed Aug 09, 2006 7:10 am Post subject: Problem with PopupFactory |
|
|
Hi guys,
I write a DatePicker, so I use PopupFactory to popup the Select-date
panel. Pop it up is no problem, it seems work well, but the problem is
that it couldnt close the popup automatically, i.e i want the popup is
closed when user click somewhere else, like the popup menu.
I'm messing up, please help. |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Aug 09, 2006 6:50 pm Post subject: Re: Problem with PopupFactory |
|
|
Nicky wrote:
| Quote: | Hi guys,
I write a DatePicker, so I use PopupFactory to popup the Select-date
panel. Pop it up is no problem, it seems work well, but the problem is
that it couldnt close the popup automatically, i.e i want the popup is
closed when user click somewhere else, like the popup menu.
I'm messing up, please help.
|
Although there is probably some way to solve this with popups, another
option is to use an unmodal JDialog with setUndecorated(true) to
contain the panel, and add this WindowListener to the dialog:
dialog.addWindowListener(new WindowAdapter()
{
public void windowDeactivated(WindowEvent arg0)
{
dialog.dispose();
}
});
Regards,
Daniel Sjöblom |
|
| Back to top |
|
 |
Nicky Guest
|
Posted: Thu Aug 10, 2006 7:10 am Post subject: Re: Problem with PopupFactory |
|
|
Thanks Daniel,
Your solution works very well.
But i still want to find out how the popup menu works, i'm still
working to find it out. If you know, please help.
Thx,
dsjoblom (AT) abo (DOT) fi wrote:
| Quote: | Nicky wrote:
Hi guys,
I write a DatePicker, so I use PopupFactory to popup the Select-date
panel. Pop it up is no problem, it seems work well, but the problem is
that it couldnt close the popup automatically, i.e i want the popup is
closed when user click somewhere else, like the popup menu.
I'm messing up, please help.
Although there is probably some way to solve this with popups, another
option is to use an unmodal JDialog with setUndecorated(true) to
contain the panel, and add this WindowListener to the dialog:
dialog.addWindowListener(new WindowAdapter()
{
public void windowDeactivated(WindowEvent arg0)
{
dialog.dispose();
}
});
Regards,
Daniel Sjöblom |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|