Jide Popup stealing focus

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.

Jide Popup stealing focus

Postby avenger007 » Mon Feb 21, 2011 4:56 am

Hi,
I have a Swing application which uses a JidePopup for any alerts which come to the application. The problem is that I want these alerts to not steal the keyboard or mouse focus whenever the main application is minimized or is in the background. It is particularly annoying when there are a lot of alerts.
Currently I'm using setAlwaysOnTop() function(setting it to false) to resolve this. Can anyone give me a better approach?
avenger007
 
Posts: 3
Joined: Mon Feb 21, 2011 4:47 am

Re: Jide Popup stealing focus

Postby JIDE Support » Mon Feb 21, 2011 10:53 am

Please try to invoke JidePopup#setOwner() so that it will automatically return the focus back to the owner after showing.

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

Re: Jide Popup stealing focus

Postby avenger007 » Mon Feb 21, 2011 9:17 pm

Actually what I meant was that the popups should not steal the focus while I'm working on a notepad or a word doc while the main application is running minimised or is in the background. In this case the focus should remain with whichever external application I'm working on.
avenger007
 
Posts: 3
Joined: Mon Feb 21, 2011 4:47 am

Re: Jide Popup stealing focus

Postby JIDE Support » Mon Feb 21, 2011 11:11 pm

I see. In fact, JidePopup won't take focus unless you call setFocusable(true) or you call setDefaultFocusComponent(a component). Could you make sure you don't call these two methods in your code?

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

Re: Jide Popup stealing focus

Postby avenger007 » Mon Feb 21, 2011 11:20 pm

I see but I do not have these methods in my code. However I'm also callling showPopup() in run() method so will it override the default behaviour and set focus to the popup even if main application is minimized or is in the background?
avenger007
 
Posts: 3
Joined: Mon Feb 21, 2011 4:47 am

Re: Jide Popup stealing focus

Postby JIDE Support » Wed Feb 23, 2011 3:14 pm

Can you please share with us a test case to investigate further? Just tried JIDE AlertDemo and could not observe any focus issue there. To debug on your end, you could invoke JideSwingUtilities.traceFocus(true) in the beginning so that you can make sure if JidePopup has the focus or not.

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

Re: Jide Popup stealing focus

Postby simonheinrich » Wed Apr 19, 2017 4:31 am

Hi,

Has this issue been resolved as I too am seeing this issue, **on some PC's**?

On my PC (and others in development), the popup does not grab focus, but on a critical user's PC it does - and this is annoying to him.

This is the code I use to create the alert - should I remove the call to alert.setOwner(mc)? "mc" is the main dockable frame window.

Code: Select all
    private Alert createAlert(long duration) {
        Alert alert = new Alert();
        alert.setOwner(mc);
        alert.setTimeout((int)duration);
        alert.setTransient(false);
        alert.setPopupBorder(BorderFactory.createLineBorder(new Color(128, 128, 128), 3));

        CustomAnimation showAnimation = new CustomAnimation(
            CustomAnimation.TYPE_ENTRANCE,
            CustomAnimation.EFFECT_FLY,
            CustomAnimation.SMOOTHNESS_MEDIUM,
            CustomAnimation.SPEED_VERY_FAST);
        showAnimation.setVisibleBounds(PortingUtils.getLocalScreenBounds());
        showAnimation.setFunctionY(CustomAnimation.FUNC_BOUNCE);
        showAnimation.setDirection(CustomAnimation.BOTTOM);
        alert.setShowAnimation(showAnimation);

        CustomAnimation hideAnimation = new CustomAnimation(
            CustomAnimation.TYPE_EXIT,
            CustomAnimation.EFFECT_FLY,
            CustomAnimation.SMOOTHNESS_MEDIUM,
            CustomAnimation.SPEED_VERY_FAST);
        hideAnimation.setVisibleBounds(PortingUtils.getLocalScreenBounds());
        hideAnimation.setDirection(CustomAnimation.BOTTOM);
        alert.setHideAnimation(hideAnimation);

        return alert;
    }
simonheinrich
 
Posts: 65
Joined: Fri Jul 03, 2009 5:33 am


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

Who is online

Users browsing this forum: No registered users and 3 guests

cron