org.thdl.savant
Class JdkVersionHacks

java.lang.Object
  |
  +--org.thdl.savant.JdkVersionHacks

public final class JdkVersionHacks
extends Object

Author:
David Chandler This class provides functionality that is not present in Java's JDK 1.2. Because we want to compile and run on a Java 2/1.2 system, we must use the Java Reflection API to provide functionality specific to Java 2/1.3 or later. At present, I haven't tested on a 1.2 box, but I have tested on a 1.3.1_04 box. If your code will break if some functionality here is not present, test the return value of the function and throw an exception. Avoid such code like the plague. This code is all written for one-shot operations thus-far. If you plan on executing a piece of code many times, you need to set up the reflection mechanism first, and then re-use it again and again. This is a two-step process. Three steps if you explicitly deconstruct the mechanism. This class is not instantiable.

Method Summary
static boolean maximizedBothSupported(Toolkit tk)
          Returns true iff maximizeJFrameInBothDirections(f) will actually have an effect.
static boolean maximizeJFrameInBothDirections(JFrame f)
          Calls f.setExtendedState(Frame.MAXIMIZED_BOTH) if possible.
static boolean undecorateJFrame(JFrame f)
          Calls f.setUndecorated(true) if possible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

undecorateJFrame

public static boolean undecorateJFrame(JFrame f)
Calls f.setUndecorated(true) if possible. Returns true if successful.


maximizeJFrameInBothDirections

public static boolean maximizeJFrameInBothDirections(JFrame f)
Calls f.setExtendedState(Frame.MAXIMIZED_BOTH) if possible. Returns true if successful.


maximizedBothSupported

public static boolean maximizedBothSupported(Toolkit tk)
Returns true iff maximizeJFrameInBothDirections(f) will actually have an effect.



These API docs were created 02/02/2003 08:19 PM.
Copyright © 2001-2002 Tibetan and Himalayan Digital Library. All Rights Reserved.
Hosted by SourceForge_Logo