GlassPane becomes inactive after clicking JInternalPane's resize border

Hi all,
I wrote a program which has a JFrame with a JDesktopPane on it's content pane.
Then I add two JInternalFrames on the desktop pane, and my own glass pane by JFrame's setGlassPane() method.
In my glass pane, I intercept all mouse events for the glass pane and If the event comes up NOT on the JDesktopPane, I convert and forward the event to component beneath the glass pane.
This almost works fine except two problems.
One is that once I pressed mouse button on the resize border of a JInternalFrame, the glass pane stops forwading event. It seems to become inactive.
Second, if I move mouse cursor on the JinternalFrame's resize-border, the cursor does not change to resize-cursor, while it changes to resize-cursor If I remove the glass pane.
Attached is the sample program (in one file) to recreate the problems.
If glass pane is working, the message "forward <EVENT_TYPE> event to <COMPONENT_CLASS_NAME>" will be shown on stdout.
I have a serious and very complecated reason to use glass pane. So I must overcome thease problems anyhow.
I appreciate any idea or help. Thanx in advance.
package GlassPaneTest;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import javax.swing.JComponent;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.SwingUtilities;
public class GlassTest extends JFrame {
    public static void main( String[] args ) {
        SwingUtilities.invokeLater( new Runnable() { public void run() {
            new GlassTest();
    public GlassTest() {
        super("");
        JDesktopPane desktop = new JDesktopPane();
        getContentPane().add(desktop);
        JInternalFrame frame1 = createFrame("1",  50, 20);
        JInternalFrame frame2 = createFrame("2", 300, 20);
        desktop.add(frame1);
        desktop.add(frame2);
        Glass glass = new Glass(desktop);
        setGlassPane(glass);
        glass.setVisible(true);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setSize(600,300);
        setVisible(true);
    private JInternalFrame createFrame(String title, int x, int y) {
        JInternalFrame f = new JInternalFrame(title,true,true,true,true);
        f.setPreferredSize(new Dimension(200,200));
        f.setLocation(x, y);
        f.pack();
        f.setVisible(true);
        return f;
    public class Glass extends JComponent
                    implements MouseListener, MouseMotionListener {
        JDesktopPane     desktop;
        public Glass(JDesktopPane desktop){
            this.desktop = desktop;
            addMouseListener(this);
            addMouseMotionListener(this);
        public void mouseMoved(MouseEvent e) { redispatch(e); }
        public void mouseDragged(MouseEvent e) { redispatch(e); }
        public void mouseClicked(MouseEvent e) { redispatch(e); }
        public void mouseEntered(MouseEvent e) { redispatch(e); }
        public void mouseExited(MouseEvent e) { redispatch(e); }
        public void mousePressed(MouseEvent e) { redispatch(e); }
        public void mouseReleased(MouseEvent e) { redispatch(e); }
        private void redispatch(MouseEvent e) {
            Point p = e.getPoint();
            int id = e.getID();
            long when = e.getWhen();
            int mod = e.getModifiers();
            int clicks = e.getClickCount();
            boolean trigger = e.isPopupTrigger();
            Component c = SwingUtilities.getDeepestComponentAt(desktop, p.x, p.y);
            Point cp = SwingUtilities.convertPoint(this, p, c);
            if (c==null) return;
            showEvent(c, id);
            MouseEvent me = new MouseEvent(c, id, when, mod, cp.x, cp.y, clicks, trigger);
            c.dispatchEvent(me);
        public void showEvent(Component target, int id) {
            String E="UNKNOWN";
            switch (id) {
            case MouseEvent.MOUSE_CLICKED: E="CLICKED"; break;
            case MouseEvent.MOUSE_DRAGGED: E="DRAGGED"; break;
            case MouseEvent.MOUSE_ENTERED: E="ENTERED"; break;
            case MouseEvent.MOUSE_EXITED: E="EXITED"; break;
            case MouseEvent.MOUSE_MOVED: E="MOVED"; break;
            case MouseEvent.MOUSE_PRESSED: E="PRESSED"; break;
            case MouseEvent.MOUSE_RELEASED: E="RELEASED"; break;
            if (target instanceof JDesktopPane) return;
            System.out.println("forwad "+E+" event to "+target.getClass().getName());
}

Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
*Do NOT click the Reset button on the Safe Mode start window.
*https://support.mozilla.org/kb/Safe+Mode
*https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

Similar Messages

  • Any active window becomes inactive after 10+ seconds.

    Any active window becomes inactive after 10+ seconds. This doesn't just affect the Finder. It makes it very difficult to type an email or post to this forum.
    No matter what window I select with the mouse, it will become deselected in a few seconds. I've ruled out the mouse and the keyboard. I don't know of any settings that would cause this. Can anyone offer a solution short of reinstalling the OS. I just finished installing my apps from receiving this computer at work on Friday.

    I just reinstalled the OS, as Archive Install with Preserve User settings checked, without running System Update to 10.5.1. All is well now. Though I haven't run all of the installed apps since reinstalling. Some of my apps are not Universal Binary (ex. QuarkXPress 6, MS Office 2004, Adobe ImageReady CS2), though that shouldn't be a problem. Right now I will be ignoring the 10.5.1 update.

  • Finder and application windows, become inactive after a few seconds

    I just finished restoring a G4 from a disk crash, installed new disk drive and a clean OS X 10.3.9. Than I restored the user's home directory and all end user applications. I am not exactly sure when I noticed this behavior, but I performed the basic troubleshooting steps below already :
    • Removed any third party System Control panel
    • AppleJack complete routine
    • Removed Finder plist
    • Switched to another user, with same result
    • Booted up in SAFE MODE, no change either
    • Reviewed system logs and other logs, and found no hint to his problem
    • Monitored Activity Viewer for unknown services running
    About every 15 seconds, the foremost window becomes grayed out/inactive. Clicking on it makes it active again, and if you start typing anything, it will not complete, due to the window going inactive again.
    I have researched the net, but found not similar issue reported.
    So if anyone can shed some light on this, short of re-installing the OS, it would make my long day or night by now.
    Thanks in advance.

    Will I lose my emails I have on there? I have numerous client email files and can't afford to lose any of them. I do have everything backed up but I'm fearful of losing important client info. What if something happened during the back up and it doesn't have my files?

  • SOA services become inactive after bouncing SOA

    Hello Experts:
    Environment:
    SOA 11.1.1.6.0
    Web Logic 10.3.6
    2 Node Cluster
    Node1 --> Admin Server, Node Manager, Managed Server 1
    Node2 --> Node Manager, manager Server 2
    http Proxy Host --> node.domain.com
    2 managed servers and 1 VIP pointing to BOTH node1 node 2.
    For example:
    Managed Server 1--> node1.domain.com
    Managed Server 2 --> node2.domain.com
    VIP (http proxy) --> node.domain.com
    (This points to node1 and node2)
    We are able to create service, deploy and use it successfully. The issue is, Once we bounce the SOA server, the services become inactive and the ONLY way to make ti work is to re-deploy!!!
    Note:
    This issue happens ONLY when we use the VIP
    Anyone seen this before??
    Any help is appreciated..

    @Sri_Sonti
    In the Admin Console, I can see both users in the security realm with the following configs:
    weblogic:
    all atributes with the "value" column blank
    groups: Administrators
    OracleSystemUser
    all atributes with the "value" column blank
    groups: OracleSystemGroup
    Also I have not found the system-jazn-data.xml file you mentioned. In that folder there's only a readme.txt file.
    Best Regards,
    luismcs
    Enter Cookie as format:
    (ex: name=val;) separate with ';'
    OKCancel

  • My B & W photos become negatives after clicking on "edit"

    I have scanned and imported several B&W but one keeps showing up in IPhoto Ok, but becomes a negative once I attempt to edit it>

    Welcome to the Apple Discussions. You're seeing this because you scanned them as grayscale photos which iPhoto doesn't support. You can rescan them as color with the RGB color provile or use another application to convert them. However the conversion will have to take place outside of iPhoto. Export the photos to a folder on the Desktop and drop the folder onto this Automator workflow application that I created: *+Convert to JPG and Embed sRGB profile+*. You can download it from Toad's Cellar.
    Once you've converted the files import them into iPhoto (you'll have to tell iPhoto to import the duplicates) and check them out. If all is well then delete the first batch of scanned B/W files.

  • Clips become grey after clicking on them

    I uploaded some video and wanted to create a new movie. However, each time I click on a clip in an attempt to drag them to the pane below, they grey out and won't move or play. Once I try the same thing with a different clip, then the original shows up again and the new clip greys out. HELP!!!

    Hi
    Just as Rich839 writes:
    (I write like this)
    *Not knowing the origin to Your problem - General approach when in trouble is as follows:*
    • Free space on internal (start-up) hard disk if it is less than 10Gb should rather have 25Gb
    • Hard disk is untidy: Repair Permissions, Repair Hard disk (Apple Disc Util tool)
    • Delete iMovie pref file - or rather start a new user/account - log into this and re-try
    • Third party plug-ins that doesn't work OK (not relevant for iMovie’08)
    • Program miss-match: iMovie 5.0.2, up to Mac OS X.4.11 AND QuickTime 7.4.1 - is OK
    • Program miss-match: iMovie 6.0.3 or 6.0.4, Mac OS X.4.11 AND QuickTime 7.4.1 - is OK (might work under Leopard)
    • Program miss-match: iMovie’08 v. 7.0.1, Mac OS X.4.11 AND QuickTime 7.4.1 - is OK (might work under Leopard)
    iMovie pref file resides: Mac Hard Disk (start-up HD)/Users/"Your account"/Library/Preferences
    and is named: com.apple.iMovie.plist
    While iMovie is NOT RUNNING - move this file out to desk-top.
    Now restart iMovie.
    QT 7.5 might be problematic – try QuickTime 7.4.5
    Yours Bengt W

  • Can a sprite become visible after a certain amount of user inactivity?

    Can a sprite become visible after a certain amount of user inactivity? like a timer triggering an event?

    Hi Kevin,
    You can look at the on timeOut event. (This is not to be confused with timeOut objects)
    There are a number of related properties, which date back from the early days of Director, and which seem to have been omitted from recent versions of the documentation, even though they still function. I give them here with their original names (prior to Director 10):
    the timeOutKeyDown
    the timeOutLapsed
    the timeOutLength
    the timeOutMouse
    the timeOutPlay
    the timeOutScript
    the lastClick
    the lastEvent
    the lastKey
    the lastRoll
    (You can also use the more recent DOM style for these last four properties: _player.lastXXX)
    Here's a very simple script which will make sprite 1 disappear when the movie starts, and reappear if the user does nothing for 5 seconds:
    on startMovie()
      sprite(1).visible = FALSE
      the timeOutLength = 300 -- = 5 seconds * 60 ticks / second
    end startMovie
    on timeOut()
      sprite(1).visible = TRUE
    end timeOut
    If you click the mouse at intervals of less than 5 seconds after starting the movie, then the sprite will remain invisible.
    NOTE: Using sprite(x).visible = FALSE will make the entire sprite channel invisible everywhere in the Score. It's better to use sprite(x).blend = 0, unless the sprite must not react to the mouse while it is invisble, in which case it is better to move it off-stage.
    Is this what you are looking for?
    James

  • Firefox tabs close when I click on a tab and windows become unresponsive after I launch a site. Using latest version for MacOSX. How do I fix this bug? Have already tried a bunch of things.

    Firefox tabs close when I simply click on a tab and windows become unresponsive after I launch a site. I am using the latest version for MacOSX but this happened a couple days ago with an older version of Firefox as well. Is this some kind of bug? How do I fix this bug? Have already tried a bunch of things like clearing/reinstalling etc. This does not help.
    == User Agent ==
    Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-us) AppleWebKit/531.22.7 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7

    You can middle click a link to open that link in a new tab.
    *Open Link in New Tab: https://addons.mozilla.org/firefox/addon/open-link-in-new-tab/
    *Tab Utilities Lite: https://addons.mozilla.org/firefox/addon/tab-utilities-lite/

  • Why do images become blurry after resizing in lightroom?

    Please help.
    I do not know why the images are becoming blurry after resizing them in lightroom and exporting them?
    Any advice?
    Thanks.

    What pixel dimensions are you resizing them down to and what quality setting and sharpening settings are you specifying in the Export panel?

  • After 8.1.3 update several apps have become inactive, and it is impossible to uninstall them. Any idea?

    After 8.1.3 update several apps have become inactive, and it is impossible to uninstall them. Any idea?

    Well now it is even more important that you provide some details as to what is happening. We were merely taking guesses, so we need feedback now.

  • How make a button inactive after the click ?

    Hi,
    how can i make a button inactive after i clik on it ? I need it becasue i have one button which play my symbol (made with this nice course https://blogs.adobe.com/edge/2012/07/18/tutorial-leveraging-independent-symbol-timelines/) but it's not working when the button is in the symbol where there is animation, it's only working when the buttons is a symbol on the stage and on the top of all over symbols, so when i clik on it works and play the symbol that i want but after is still active so i can't place another button at the exact same place of the first because it will play the first button and i need to put 20 buttons, anyone can help me please ? My buttons is just an empty rectangle so i don't talk about turn of the visibility but turn of th "activity"
    Thanks a lot

    If you prefer you can put the code in compositionReady
    Here is a sampe on how to use a next and prev buttons to change data.I have some other examples I will add later but this one could give you an idea on how to do it.
    This one uses data from an array and then moves through the info:
    https://app.box.com/s/78ya0labbydgwogxra2a
    If you are playing symbols then use the rigth scope to get to them.
    I would make a array of the symbol names and use it the same way like I did the array for the info.
    sym.getSymbol(mysymbolArray[i]).play();

  • Pages wont load, links become inactive

    Hello, I have had this issue for a while and I have finally decided to ask for some help, usually I can find answers to my problems but am a bit stumped on this one.
    My issue is this:
    I do a search, right click link and open in new tab - works 80% of the time. ok other 20% page wont open just stuck. Whats interesting though is I have found if I refresh the google search page I can then open the link fine, - the first open page is still sitting there spinning around, sometimes when the link opens this will kick the first try into finding the site. Now it has been getting worse. Now links on web pages becoming inactive as in i click on the link and nothing happens, right click and it does not have open in new tab ect. Its as though the page has lost all of it connections to the internet. sometimes when i refresh the page after a link not working it will open the linked page? bizarre.
    I have done a lot of research on this and have done things like clear the cache,
    uninstalled and reinstalled firefox,
    changed to new profile,
    and a myriad of other things mainly in regards to pages wont load.
    does this happen in other browsers, I barely use other browsers so haven't noticed that it does.
    I use ghostery and ad block plus, ad block pop up, ad block is set to exclude google.
    does this happen on other computers with firefox on my wireless network? not as much sometimes pages wont load but can put that down to internet or wireless issues.
    I cant rule out it being a browser issue because when pages wont load from google links i can open bookmarks and the pages load as well as links from them out to the internet, and the page open via google still sits on spinning, try the link again and again and still wont load.
    Could it just be a bad link? it happens far too often for the internet to have that many bad links.
    other clues,
    Ad block plus and ghostery have used this and updated for a long time with out these issues.
    Issues only started with the last couple of firefox updates.
    something of interest is that this issue started around the time we upgraded to adsl 2+ from adsl and got a new modem, but the internet is still connected and I can still surf from the bookmarks so that could be just a coincidence so I still cant rule out a browser issue.
    oh does the page time out - eventually yes but takes a long time, I do see it saying waiting for fonts.google or other such things but tried all of those fixes and nothing helps.
    I hope I have been able to get my issue across.
    Any help would be greatly appreciated
    Soleous75

    Hello,
    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information. <br>
    '''Note''': ''This will cause you to lose any Extensions and some Preferences.''
    *Open websites will not be saved in Firefox versions lower than 25.
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!
    Thank you.

  • Finder Window "Inactive" when clicked on and vice versa

    For some reason, windows I click on in the Finder will become inactive and won't become active unless I click off of them on the desktop. The behavior continues until I restart the finder. I was wondering if this was maybe an issue specific to Intel Macs since it's happening to me on my new Intel Mac mini.
    I should also note that this behavior is completely random as far as I can tell. Usually just closing all the open windows and opening a new one will fix it, but it usually comes back shortly after. Restarting the Finder seems to be the best way to get rid of it.
    Has anyone seen this and/or know a way to fix it?

    lains_navi,
    If this behavior started after the 10.4.6 Update, I would recommend that you download and reinstall the Mac OS X 10.4.6 for Intel.
    ;~)

  • Finder menus grey (items inactive) after start up

    I have the following issue: Recently the menu items in my Finder menus have become grey immediately after start up, i.e. they are inactive. The menus become active after I click around a bit and then select them again. Quite annoying.
    Any ideas what the problem is and how I get rid of it?
    Thanks in advance.

    AT LAST!!!!
    I've had this problem on my MacBook for a while, it drives me CRAZY!!!!! Luckily, I rarely restart my Mac, but it's nice to know I'm not alone with this problem.
    I've tried EVERYTHING - repaired permissions, ran Cocktail on Autopilot, deleted preferences, and the problem still remains.
    The only thing I can say with any certainty is if you click the Finder icon in the Dock (which will create a new Finder window), the Menu items will then become 'clickable'. Other than that, I have to wait forever to be able to use them.
    Glad I ran into this post. I will subscribe and let you all know if I eventually manage to fix the problem.

  • Applications become inactive and unusable, losing focus

    So far this has happened with most apps.
    Don't know what is causing it, but it may be Time Machine.
    Intermittently, and more some days than others, applications become inactive and unusable. The symptom is when you try and switch to an application, it does not come to focus at the front.
    For example, Mail is open, but I cannot do anything within the app. I can move the application window with the mouse, but cannot click any buttons at all.
    If I go back to the finder and switch to Mail, it still says Finder in the top-left menu. It will only show the name of the last visited (working) app, and never Mail.
    I can't find a way to resurrect Mail when this happens, including waiting patiently, using the Dock (both single click, and long click), using TAB and COMMAND to switch to the app, using the Force Quit menu to switch and even putting the machine to sleep. Nothing will fix it apart from Force Quitting the app, and restarting it.
    This has happened with Safari, Mail, iTunes, iCal, Garageband (meaning lost work), as well as many Adobe apps, which suggests it is a problem with the system software.
    Has anyone had similar issues, or even better does anyone know how to fix this?
    Many thanks!

    Create a new User go to System Preferences >> Accounts >> "+" (make it an admin acct) and test the apps in this new account, if they work the problem is isolated to your User and not systemwide.
    If the issue is limited to your user account try starting up Safe Mode (It will take more time to startup in Safe Mode because it runs a directory check.)
    If your apps functions correctly that way, go to System Preferences >> Accounts >> Login Items, and remove them. Boot normally and test. If not go to ~(yourHome)/Library/Contextual Menu Items and move whatever is there to the desktop. Then do the same with /Library/Contextual Menu Items. Lastly, try moving ~(yourHome)/Library/Fonts to your desktop and restarting.
    Log out/in or restart, if that sorts it start putting items back one at a time until you find the culprit.
    If the issue is systemwide then, you may be able to repair this with the The 10.6.2 Combo Update This is a fuller install, as opposed to an incremental "delta" update so it should overwrite any files that are damaged or missing. It does not matter if you have applied it before.
    Remember to Verify Disk before update and repair permissions after update from /Applications/Utilities/Disk Utility.
    -mj

Maybe you are looking for

  • More than 5 tabs in tab bar controller

    Hi, I'm totally at a lost trying to get 6 tabs connected to my tab bar controller, which was created using the tab bar controller template.  Everything thing works fine with 5 view controllers.  When I add a 6th view controller I get the "More" tab i

  • Exporting and Compression

    Help! I have been using Garageband since version 1 came out, and I have finally gotten to the point where I can't stand the sound of my songs when they are exported to Itunes. Is there a way to keep the initial integrity of my songs when converting t

  • Grayed out

    Once I bring in a clip or multitrack from final cut to soundtrack pro...the options such as normalizing are grayed out. What am I doing wrong? I can play the clip fine but can't do anything to it, like normalize...all effx are grayed out.

  • Activity Types for a Work Center

    Dear Experts, I have done KL01 and KP26 transactions. That is I ahve defined the activity and assignes a cost conter to it. Still, when I am trying to enter the activity type in costing tab while creating the work center, the system throws an error a

  • Trays in Smart Forms

    Hello, I print billing documents from vf03, using a Smart Form. There is a need to choose different trays during printout, based on variable value. 1. I use COMMAND NODE in MAIN window, but is there any other option to select the tray manually during