This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
dev build 200311241900 When I hit ALT-TAB to switch to another window, Netbeans thinks I'm hitting ALT for the pulldown menus such that when I return to Netbeans the focus is now in the pulldown menus. I expect it to maintain the focus I had before hitting ALT-TAB to change to another application.
I will check. AFAIK Alt-TAB should be processed by OS and not posted to application (NB in this case) at all.
It works for me on JDK 1.4.2_01, Win XP, dev build from 19 Jan 200401191900. Alt-TAB switches among apps as usual. Any more info?
I was in Explorer (focus on any tree node in Filesystems tab). Where is focus in your case?
I can reproduce the bug in dev build 200401111900 when my focus is in EXPLORER and I hit ALT-TAB. The key to reproducing it is to hit ALT-TAB very quickly. If you hit ALT+TAB, pause for a second, let go; the focus will be fine. If you hit ALT+TAB quickly and let go almost instantenously, the focus will be shifted to another app but Netbeans will trigger the pulldown menu. If you pause one second, focus works fine. If you pause less than 100ms the problem occurs.
Forgot to mention, I'm using JDK 1.4.2_03 under XP sp1.
I tested now with JDK 1.4.2_03 and no success. I noticed when I press Alt I see menu items in menu bar or more precisely their menmonic chars are underlined. I believe only pressing Alt cannot invoke any pull down menu from main menu. I tried to press TAB after Alt as fast as I am able but I did not see any pulldown menu rolled down. I would recommend to scan somehow what exactly key events are comming when you press Alt-TAB. Are you sure your keyboard does not send anything else???? I have no better explanation. Sorry. Is anybody else able to reproduce this? You could try simple Swing app (eg. menu example from Swing tutorial and add logging of key events) to make sure no other events are generated.
My NB dev build is from 19 Jan 2004. 200401191900
Hmm you are right. I used all my hands and now focus is shifted to File menu item in main menu. I will try to find where does this focus transfer come from.
Problem is simpler: If I have focus in for example editor and press/release Alt key focus is trasnsferred to main menu. Again press/release Alt focus goes back to editor. And again. Happens always. I found that Windows RootPaneUI is processing Alt pressed/released. This does not happens on Linux. Problem is that I am not able to reproduce it with simple Swing menu demo with editable area. You can avoid Alt-TAB, Alt is enough and you need not have fast hands :).
It is correct behaviour of Windows L&F. Please check behaviour of some native Windows app. It is the same. So it is not bug but feature. If I set L7F of my small test app to Windows eg using java -Dswing.defaultlaf=com.sun.java.swing.plaf.windows.WindowsLookAndFeel MyApp it works like described.
Created attachment 13008 [details] Simple test app (slightly modified MenuDemo from Java Swing tutorial)
Marek, While hitting and releasing ALT transfers focus from the application to the menus and back is normal for any Windows app, ALT-TAB never transfers focus to the menus in a native windows app (I'm using Microsoft Outlook as reference). So in conclusion, my view is that this bug is still open and furthermore it only occurs in Netbeans and not in any other native windows application. Again, the bug is with "ALT-TAB", not with "ALT" alone. After playing around with MenuDemo (which I modified to use the native L&F) I believe this is a Windows L&F bug <sigh> I guess now I have to wait 2 years before Sun fixes it :( Thanks anyway, Gili
Ok I see. When I investigated I put log with call stack dump to Component.requestFocusHelper(). WindowsRootPaneUI processes altReleased, altPressed to emulate behaviour of native Win apps. When you press Alt-TAB Alt pressed Alt released events are generated. You can file issue against JDK. I attach log FYI.
Created attachment 13018 [details] Log from Component.requestFocusHelper
Marku, would it be possible to file bug against JDK yourself? I't not that time expensive. If so, then please add JDK bug number here in comment. Thanks.
I just tested latest JDK 1.5.0 build 33 (beta 2) and this problem does not happen there.
Marek, Is JDK 1.5 stable enough for daily use yet? David, See related issues 4504821, 4161030, 4841881 (on Bug Parade). I've also filed a separate bug report just in case (I don't have an external bug ID yet). Specifically, bug id 4841881 seems to be identical to the one I just filed but they closed it with "cannot reproduce". Hopefully this is really fixed in JDK 1.5 (final).
Marek, Is it possible to pass your log on to the Java team to work against BugParade issue #4841881? Maybe this will help them reproduce the problem or rule it as CLOSED-FIXED.
Yes it is issue #4841881. In evaluation it is said that it is not reproducible on any JDK 1.5 build. I could not reproduce it on JDK 1.5 build 33 (beta 2). So no need to file it again against JDK. Thanks for your time.
*** Issue 39450 has been marked as a duplicate of this issue. ***
Reproducible using dev build 200401301900, JDK 1.5.1 beta 1 Someone please reproduce it on another machine.
I cannot reproduce it with JDK 1.5 beta 2 (build 47) and NB release 36. >System Info: Product Version = NetBeans IDE 3.6 (Build 200404071636) Operating System = Windows XP version 5.1 running on x86 Java; VM; Vendor = 1.5.0-beta2; Java HotSpot(TM) Client VM 1.5.0-beta2-b47; Sun Microsystems Inc. I tried many times to press Alt-TAB quickly and focus stays where it was before (either editor or explorer). The same way worked with JDK 1.4.2_x ie. I was able to reproduce this focus move to menu. But if I press and release only Alt key in NB focus is moved to menu when Alt key is released. Press and release Alt again and focus goes back. So it might be some weird key combination in your case. In test I press quickly first Alt and then TAB. I release both. Now next app is activated and focus is NOT in menu in NB window. (I arranged apps so that I can see NB window even if other app window is activated.) Closing this issue.
I will verify once beta 2 comes out. When is it being released to the public?
I do not know if there is any official date. I can just recommend to check java.sun.com regularly.
I also suffer from this problem and can verify that it works fine on 1.5.0-beta2.