Example usage for java.awt Toolkit isDynamicLayoutActive

List of usage examples for java.awt Toolkit isDynamicLayoutActive

Introduction

In this page you can find the example usage for java.awt Toolkit isDynamicLayoutActive.

Prototype

public boolean isDynamicLayoutActive() throws HeadlessException 

Source Link

Document

Returns whether dynamic layout of Containers on resize is currently enabled on the underlying operating system and/or window manager.

Usage

From source file:DynamicLayout.java

public static void main(String[] args) {
    Toolkit tk = Toolkit.getDefaultToolkit();
    Object prop = tk.getDesktopProperty("awt.dynamicLayoutSupported");

    System.out.println(tk.isDynamicLayoutActive() ? "yes" : "no");
    if (tk.isDynamicLayoutActive())
        tk.setDynamicLayout(false);//  w  ww.  j av  a 2  s. c  o m
    else
        tk.setDynamicLayout(true);

    System.out.println(tk.isDynamicLayoutActive() ? "yes" : "no");
}

From source file:org.rdv.RDV.java

/**
 * Initializes the application before startup.
 * @param args  the command line arguments
 *//*w  w w.  j  a  va 2 s.  c  o  m*/
@Override
protected void initialize(String[] args) {
    super.initialize(args);

    this.args = args;

    //enable dynamic layout during application resize
    Toolkit toolkit = Toolkit.getDefaultToolkit();
    if (!toolkit.isDynamicLayoutActive()) {
        toolkit.setDynamicLayout(true);
    }

    //disable default drop target for swing components
    System.setProperty("suppressSwingDropSupport", "true");
}