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.

Bug 29938 - Focus is incorrectly set when popup on tab is invoked
Summary: Focus is incorrectly set when popup on tab is invoked
Status: VERIFIED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: mslama
URL:
Keywords: FOCUS, JDK_SPECIFIC
Depends on:
Blocks:
 
Reported: 2003-01-10 09:52 UTC by mslama
Modified: 2008-12-23 09:41 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Call stack when requestFocus() is called (1.98 KB, text/plain)
2003-01-10 09:53 UTC, mslama
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mslama 2003-01-10 09:52:07 UTC
When I fixed issue #28351 I found another bug
specific to JDK 1.4 (reproducible on JDK 1.4.1_01,
1.4.2_b10). When popup is invoked on tab focus is
incorrectly transferred to another component.

Steps to reproduce:
1.Start IDE in MDI.
2.Open 1 source (README.txt) in left area in
Source Editor.
3.Open 2 source (java files) in center area in
Source Editor.
4.Make sure one java source is focused (you see
cursor inside text).
5.Invoke popup on second tab in center area
(second java source).
6.Popup is shown but focus is now inside README
component.

It happens only on JDK 1.4 not on JDK 1.3.1. I
investigated it and it is caused by
FocusTraversalPolicy of InternalFrameTypeImpl.
When JTabbedPane is validated on calls
requestDefaultFocus() and FocusTraversalPolicy is
responsible for returning correct default
component however in this case it returns
incorrect component.

Solution would be to overwrite
FocusTraversalPolicy.getDefaultComponent().
Problem is that this focus handling is introduced
since JDK 1.4. It means that fix would require a
lot of ugly code. Should we fix it anyway?
Comment 1 mslama 2003-01-10 09:53:33 UTC
Created attachment 8519 [details]
Call stack when requestFocus() is called
Comment 2 mslama 2003-01-10 10:44:05 UTC
Thing is worse: It is enough to just select second tab in pane by left
mouse click. No need to invoke popup. So to focus second component in
center pane you must select tab and then click again inside pane.
Comment 3 Marian Mirilovic 2003-01-10 10:46:18 UTC
I have reproduced it, significant is to invoke popup menu by
right-click on the another than already selected tab, because if you
invoke popup menu on selected tab it woks fine.
Comment 4 Peter Zavadsky 2003-01-29 13:54:59 UTC
Leaving this for Marek for now.
Comment 5 Marian Mirilovic 2003-11-26 12:58:01 UTC
Because Window System v1 will not be supported from now by our team, all old
winsys issues (now "core/window system v1" issues) are going to be closed as
WONTFIX. 

Changes in API which emerged both from UI spec 
and problems with adjusting to the older API are described in the document
http://core.netbeans.org/windowsystem/changes.html.
 It shows also recommends how the client code should be adjusted to the new
window system.

If you think this issue apply also to the new winsys then change the
subcomponent (to "core/window system") and REOPEN it.
Comment 6 Marian Mirilovic 2004-02-16 21:22:47 UTC
it works fine now ,
verified in [nb_dev](200402151900)