javax.swing.plaf.basic
Class BasicTabbedPaneUI.FocusHandler

java.lang.Object
  extended by java.awt.event.FocusAdapter
      extended by javax.swing.plaf.basic.BasicTabbedPaneUI.FocusHandler
All Implemented Interfaces:
FocusListener, EventListener
Enclosing class:
BasicTabbedPaneUI

public class BasicTabbedPaneUI.FocusHandler
extends FocusAdapter

A helper class that handles focus.

The purpose of this class is to implement a more flexible focus handling for the tabbed pane, which is used to determine whether the focus indicator should be painted or not. When in scrolling layout mode the area containing the tabs is a scrollpane, so simply testing whether the tabbed pane has the focus does not work.

The FocusHandler is installed on the scrollpane and the tabbed pane and sets the variable hasFocus to false only when both components do not hold the focus.


Constructor Summary
BasicTabbedPaneUI.FocusHandler()
           
 
Method Summary
 void focusGained(FocusEvent e)
          This method is called when the component gains focus.
 void focusLost(FocusEvent e)
          This method is called when the component loses focus.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicTabbedPaneUI.FocusHandler

public BasicTabbedPaneUI.FocusHandler()
Method Detail

focusGained

public void focusGained(FocusEvent e)
This method is called when the component gains focus.

Specified by:
focusGained in interface FocusListener
Overrides:
focusGained in class FocusAdapter
Parameters:
e - The FocusEvent.

focusLost

public void focusLost(FocusEvent e)
This method is called when the component loses focus.

Specified by:
focusLost in interface FocusListener
Overrides:
focusLost in class FocusAdapter
Parameters:
e - The FocusEvent.