Java AWT Toolkit check supported window state

Description

Java AWT Toolkit check supported window state

import java.awt.Frame;
import java.awt.Toolkit;

public class Main {
   public static void main(String[] argv) {
      Toolkit tk = Toolkit.getDefaultToolkit();
      if (!(tk.isFrameStateSupported(Frame.ICONIFIED))) {
         System.out.println("Your window manager doesn't support ICONIFIED.");
      } else/*w  w  w. j a va  2s . c o m*/
         System.out.println("Your window manager supports ICONIFIED.");
      if (!(tk.isFrameStateSupported(Frame.MAXIMIZED_VERT))) {
         System.out.println("Your window manager doesn't support MAXIMIZED_VERT.");
      } else
         System.out.println("Your window manager supports MAXIMIZED_VERT.");
      if (!(tk.isFrameStateSupported(Frame.MAXIMIZED_HORIZ))) {
         System.out.println("Your window manager doesn't support MAXIMIZED_HORIZ.");
      } else
         System.out.println("Your window manager supports MAXIMIZED_HORIZ.");
      if (!(tk.isFrameStateSupported(Frame.MAXIMIZED_BOTH))) {
         System.out.println("Your window manager doesn't support MAXIMIZED_BOTH.");
      } else {
         System.out.println("Your window manager supports MAXIMIZED_BOTH.");
      }
   }
}



PreviousNext

Related