JidePopup staying visible

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

JidePopup staying visible

Postby stacecase » Fri Nov 07, 2008 1:01 pm

Is there a way to keep the JidePopup visible when you click outside of the popup?

Here is the code for my popup:
Code: Select all
    private JButton test(){
            final JButton msrmtXrefBtn = new JButton();
            final JidePopup popup = new JidePopup();
           
            JPanel mainPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
            JButton btn  = new JButton("test");
            mainPanel.add(btn);
            mainPanel.add(new JButton("test1"));
            mainPanel.add(new JButton("Test2"));
            popup.getContentPane().add(mainPanel);
            popup.setDefaultFocusComponent(btn);
            popup.setFocusable(true);

            AbstractAction action = new AbstractAction("Test tab order") {

            public void actionPerformed(ActionEvent e) {
                        popup.updateUI();
                        popup.setOwner(msrmtXrefBtn);
                        popup.setResizable(false);
                        popup.setMovable(false);

                        if (popup.isPopupVisible()) {
                            //popup.hidePopup();
                        }
                        else {
                            popup.showPopup();
                        }
                    }
                };
            msrmtXrefBtn.setAction(action);
            msrmtXrefBtn.setName("" + action.getValue(Action.NAME));           
            return msrmtXrefBtn;
        }



Thanks,
Stacy
stacecase
 
Posts: 3
Joined: Tue Sep 02, 2008 9:56 pm

Re: JidePopup staying visible

Postby JIDE Support » Fri Nov 07, 2008 2:14 pm

You can try JidePopup#setTransient(false).
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: JidePopup staying visible

Postby stacecase » Fri Nov 07, 2008 3:04 pm

Thank you. It worked great. I wasn't sure what that attribute meant.
stacecase
 
Posts: 3
Joined: Tue Sep 02, 2008 9:56 pm

Re: JidePopup staying visible

Postby siddhaye » Mon Jan 12, 2009 11:04 am

hi,
I have a similar question to the one above.
actually, I used setTransient(false). It works fine on Windows, but on a Mac, if I click elsewhere, the popup gets hidden. Actually, it is still there on the screen, however, the JFrame (i.e. main application window) is painted on top of the JidePopup which gets thrown beneath the JFrame and thus gets hidden. Any idea how to fix this?
thanks,
Sachin
siddhaye
 
Posts: 16
Joined: Mon Oct 20, 2008 9:39 am

Re: JidePopup staying visible

Postby JIDE Support » Mon Jan 12, 2009 11:35 am

I am not quite sure. If the owner of the popup is set to the main window, the popup should never be sent to the back of the main window. At least that's the case with Windows. It would be strange if Mac doesn't do the same thing.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: JidePopup staying visible

Postby siddhaye » Mon Jan 12, 2009 3:08 pm

This is what I am doing...

popup.setOwner(MainFrame.getInstance());
popup.getContentPane().add(myPanel);
popup.setPreferredSize(new Dimension(460, 350));
popup.setResizable(true);
popup.setMovable(true);
popup.setAttachable(false);
popup.setDetached(false);
popup.setTransient(false);

I repeatedly hide and show the same popup. For good measure, just before I show it, I again set the owner using the above method. I have two questions
1) On Windows, it works fine as expected. Once its shown I can click anywhere on the screen and it stays put. Except when I resize the JFrame, then it gets hidden beneath the JFrame and I have to explicitly show it again through a menu option I have created.
2) On Mac, it works fine the very first time. That is, the popup is visible on screen. Further, I can click anywhere on the screen and the popup stays in place. Then if I hide it and show it again, now it starts behaving oddly. It gets hidden automatically if I click anywhere on the screen. And of course as above, when the JFrame is resized, it again gets hidden.

Any thoughts on how to fix this?

thanks,
Sachin
siddhaye
 
Posts: 16
Joined: Mon Oct 20, 2008 9:39 am

Re: JidePopup staying visible

Postby siddhaye » Wed Jan 14, 2009 1:04 pm

any ideas on my question?
siddhaye
 
Posts: 16
Joined: Mon Oct 20, 2008 9:39 am

Re: JidePopup staying visible

Postby JIDE Support » Wed Jan 14, 2009 1:08 pm

Not yet. I will get to it asap.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: JidePopup staying visible

Postby JIDE Support » Tue Jan 20, 2009 2:26 pm

I reproduced it on Mac but not sure how to fix it. It could well be a JDK bug on Mac because, a window, if the parent is set to another window, should never hide behind the parent window. The only explanation is Mac handles window management in a different way but I have no clue how to fix it.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

JidePopup resize problem

Postby gupt.sumeet » Thu Feb 03, 2011 10:52 pm

I have encoutered a problem in jidepopup on resizing the popup/panel inside it.

When i resize the popup /panel , it only display the component in side the previous size frame(on increasing the size of popup) .
gupt.sumeet
 
Posts: 1
Joined: Thu Feb 03, 2011 10:21 pm

Re: JidePopup staying visible

Postby JIDE Support » Fri Feb 04, 2011 9:29 am

Please try to invoke JidePopup#setKeepPreviousSize(false).

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 74 guests