Groovy Documentation

com.wordpress.tipsforjava.swing
[Java] Class TabFocusHandler

java.lang.Object
  com.wordpress.tipsforjava.swing.TabFocusHandler
All Implemented Interfaces:
ChangeListener, PropertyChangeListener

public class TabFocusHandler
extends Object

Manage the focus when a new tab is selected. You can select a focus policy: a) Reset Focus - focus is reset to the first focusable component on the tab b) Retain Focus - focus returns to the last component with focus on the tab In addition you add tabs that you want to exclude from the focus policy, in which case the other policy will be in effect.

Authors:
Rob Camick
Darryl Burke


Field Summary
static int RESET_FOCUS

static int RETAIN_FOCUS

private HashSet exceptions

private int focusPolicy

private HashMap tabFocus

private JTabbedPane tabbedPane

 
Constructor Summary
TabFocusHandler(JTabbedPane tabbedPane)

TabFocusHandler(JTabbedPane tabbedPane, int focusPolicy)

 
Method Summary
void addException(int index)

void propertyChange(PropertyChangeEvent e)

void stateChanged(ChangeEvent e)

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Field Detail

RESET_FOCUS

public static final int RESET_FOCUS


RETAIN_FOCUS

public static final int RETAIN_FOCUS


exceptions

private HashSet exceptions


focusPolicy

private int focusPolicy


tabFocus

private HashMap tabFocus


tabbedPane

private JTabbedPane tabbedPane


 
Constructor Detail

TabFocusHandler

public TabFocusHandler(JTabbedPane tabbedPane)


TabFocusHandler

public TabFocusHandler(JTabbedPane tabbedPane, int focusPolicy)


 
Method Detail

addException

public void addException(int index)


propertyChange

public void propertyChange(PropertyChangeEvent e)


stateChanged

public void stateChanged(ChangeEvent e)


 

Groovy Documentation