Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 120880 - Editor Focus problems
Editor Focus problems
Status: RESOLVED DUPLICATE of bug 119617
Product: editor
Classification: Unclassified
Component: -- Other --
Macintosh All
: P2 with 1 vote (vote)
: 6.x
Assigned To: issues@editor
: 122219 126057 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2007-11-01 18:51 UTC by Joelle Lam
Modified: 2008-02-14 14:56 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description Joelle Lam 2007-11-01 18:51:46 UTC
The editor loose focuses often.

1) Create a java class
2) Add the lines Rectangle rect = new Rectangle();
3) Click on the light bulb to view the available classes to import.
4) Select the appropriate imported class.
5) Notice that you can no longer type in the editor.

Open any dialog box (ie New Page) and then the focus returns.

Unfortunately since I don't have a break key on the Mac I can't use that windowing feature to determine who has focus.
This problem seems to only happen on the Mac, but I believe there are enough users today using it, that this should be
considered high priority.  I will open this a P2 since there is a work around, but I believe it should be considered a P1.
Comment 1 Jan Lahoda 2007-11-01 19:39:27 UTC
What I know about this from previous reports on similar issues:
-there is a bug on Apple JDK that is causing this problem (Milos should know more about this)
-Honza (jpokorsky) did a workaround for this issue in NB codebase some time ago
-since then we got a report that sometimes the workaround does not help. The problem however was not reproducible on the
Mac available to Honza, so he couldn't come with a better workaround.

In my opinion, vast majority of users do not use mouse to invoke the editor hints (similarly for CC and Insert Code),
which does not cause this problem, AFAIK. The workaround is to use Alt-Enter, arrow keys and Enter/ESC to control the
hints instead of mouse.

Sorry, but unless someone comes with a better workaround for this problem, we probably cannot do anything about this.
Comment 2 Jan Lahoda 2007-11-01 19:45:11 UTC
I mean: vast majority of users use keyboard instead of mouse to work with hints, etc., and use of keyboard does not, to
my knowledge, cause this problem.
Comment 3 Joelle Lam 2007-11-01 19:57:05 UTC
But it is not only editor hints that cause this.  This was just an example of something I could regularly reproduce.  I
hit it all the time just using debugger.  I understand if you are unable to fix it, but it should be viewed as a issue
that should be fixed for 6.0.
Comment 4 Jan Pokorsky 2007-11-01 20:30:45 UTC
For hints, there is already issue #119430. You can try to reproduce with the attached patch and send us your
messages.log. AFAIK we do not have available any general solution that would fix all popupXfocus issues on Mac.
Comment 5 Vitezslav Stejskal 2007-11-01 21:26:56 UTC
I understand that this is a high priority for Mac users, but since we don't have solution for it I'm going to ask for
Nb6 waiver. If this is not approved it is likely to become a showstopper for the release.
Comment 6 Joelle Lam 2007-11-01 21:36:17 UTC
Sounds good.  I will work on a more reproducable test case for the other scenarios as well as update my build with the
Comment 7 Milos Kleint 2007-11-01 22:25:01 UTC
just for the record:
there were a bunch of serious focus lost issues in 1.5 developer previews on mac. We have workarounded some, apple fixes
others but some randomly prevail. The randomness seems to vary computer by computer. I haven't seen the it on mmy mac
for ages. Probably both usage patterns and hardware at play. Even when I tried to reproduce the "mouse click on hint"
focus lost case for jpokorsky, it always worked fine for me.
Comment 8 Torbjorn Norbye 2007-11-02 17:41:46 UTC
Just as another datapoint:

Is this NetBeans specific or a general Swing bug on OSX?
Comment 9 Milos Kleint 2007-11-02 19:11:54 UTC
we were solving many focus related problems  for 5.0/5.5 in regard to apple's jdk 1.5 release. 
It's working on other platforms fine, so I assume this to be another apple bug. However when I was looking into it, I
was not able to produce a simple swing-only testcase that demonstrates the problem.
Comment 10 Torbjorn Norbye 2007-11-02 19:22:43 UTC
One source of Swing bugs is updating GUI state from other threads than the AWT thread. This can lead to all kinds of bad
bugs which appears to be Swing bugs but really are application bugs. Some years ago I remember playing with using
patched versions of JComponent (set via bootclasspath) which would do an assert SwingUtilities.isEventDispatchThread()
from all the relevant component methods, in order to try to catch code that is illegally updating GUI state.  We might
have such bugs lingering in the code, and whether or not it shows up as Swing bugs varies from OSX to other platforms.
It might be a useful thing to look into, especially testing areas reported to have a lot of problems with focus.
Comment 11 Milos Kleint 2007-11-02 19:34:03 UTC
tor: go for it, if you feeling lucky today.
Comment 12 Vitezslav Stejskal 2007-11-04 09:49:26 UTC
There were no objections against the waiver request, so I'm marking it as 6.0_WAIVER_APPROVED.
Comment 13 Jiri Prox 2007-11-19 09:06:38 UTC
*** Issue 122219 has been marked as a duplicate of this issue. ***
Comment 14 Jiri Prox 2008-01-28 09:11:17 UTC
*** Issue 126057 has been marked as a duplicate of this issue. ***
Comment 15 Max Sauer 2008-02-14 14:56:11 UTC
Since this issue has same symptoms as issue 119617, which contains more information and more recent comments, I'm
marking this as duplicate.

*** This issue has been marked as a duplicate of 119617 ***

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo