JDK-5018529 : Mouse click over selected Tab in JTabbedPane doesn't bring focus border
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2004-03-23
  • Updated: 2004-08-26
  • Resolved: 2004-08-26
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Description
Ideally if a component is focusable, than mouse click on it should bring focus border over it
But clicking on selected Tab in JTabbedPane doesn't bring focus border over it in all the
java L&Fs while if you compare with some of the native behaviour, say win XP than this is not the
case.

Steps to reproduce:
1) Open SwingSet2(Keep default Java L&F & Ocean theme)
2) Go to JTabbedPane demo
3) You should see a selected tab "Laine"
4) Now click on the "Laine" tab and note it will not bring
   any focus border, Now if you click on someother neighbouring tab and click
   "Laine" back, than you will see a focus border over it.

Reproducible in all L&F including windows.

###@###.### 2004-03-23

Comments
EVALUATION Here is how focus is supposed to behave with respect to JTabbedPanes: When a tab is displayed, focus should go to the first focusable component within the tab. Clicking on an UNSELECTED tab should switch to that tab and give focus to the first focusable component within that tab. Only when an ALREADY SELECTED tab is clicked (or if a tab already has focus) should the focus be given to a tab when it is clicked. One can use Windows JTabbedPanes as an example. Currently, this is broken and/or has regressed. It needs to be fixed. See also 5018557 which I have closed as a duplicate. I am interested in this bug and would like to participate in testing the fix before it goes back. Thanks! ###@###.### 2004-03-31 Name: drR10255 Date: 04/25/2004 The problem really exists. ====================================================================== This was a regression introduced in merging in Synth. I have restored the behavior to what it was in 1.4.2 releases and earlier. It turns out this is slightly wrong though, take a look at 5092589 for details of what it should be. This was fixed as part of 5056403, closing out as such. ###@###.### 2004-08-26
26-08-2004