lapis.swing
Class SwingCompatibility
java.lang.Object
lapis.swing.SwingCompatibility
- public abstract class SwingCompatibility
- extends Object
Utility methods for compatibility with older versions of Swing.
This code uses reflection to call Swing methods that are not available
in all JDK versions, or that are deprecated in newer versions
but still need to be called on older versions.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
debug
public static Debug debug
SwingCompatibility
public SwingCompatibility()
disableBuggyFocusManager
public static void disableBuggyFocusManager()
- Disables buggy Swing focus manager on certain versions.
- Effects:
- On JDK 1.2/1.3, calls
FocusManager.disableSwingFocusManager()
to prevent a bug that sends focus to the toolbar after using
menu commands. On later versions of Java, does nothing.
setScrollTabLayoutPolicy
public static void setScrollTabLayoutPolicy(JTabbedPane tabpane)
- Calls
JTabbedPane.setTabLayoutPolicy(int)
if it's
available.
- Parameters:
tabpane
- tabbed pane to call method on- Effects:
- If tabpane provides the setTabLayoutPolicy
method (Java 1.4+), then tabpane.setTabLayoutPolicy
(SCROLL_TAB_LAYOUT) is called; see its docs for effects.
Otherwise, no effect.