Example usage for java.awt Dialog isUndecorated

List of usage examples for java.awt Dialog isUndecorated

Introduction

In this page you can find the example usage for java.awt Dialog isUndecorated.

Prototype

public boolean isUndecorated() 

Source Link

Document

Indicates whether this dialog is undecorated.

Usage

From source file:Main.java

public static void fadeIn(final Dialog win) {
    if (!win.isUndecorated()) {
        return;/*from  w  ww.  ja  v a2s .co m*/
    }
    final Timer timer = new Timer(30, null);
    timer.setRepeats(true);
    timer.addActionListener(new ActionListener() {
        private float opacity = 0;

        @Override
        public void actionPerformed(ActionEvent e) {
            opacity += 0.05f;
            win.setOpacity(Math.min(opacity, 1f));
            if (opacity >= 1) {
                timer.stop();
            }
        }
    });
    win.setOpacity(0);
    timer.start();
    win.setVisible(true);
}