Hi,
This is not a huge problem but I am wondering if there is a solution. In the example below a window opens with a button and if you press that button another window opens, in Windows 7 it does a little effect when it opens. When you close the new window it does another effect for closing. If I press the button again it just pops up without the effect. Is there a way to fix that so that the effect always works without re-creating the frame?
import javax.swing.*;
import java.awt.event.*;
public class asd
{
private static JFrame frame2;
public static void main (String[] args)
{
frame2 = new JFrame();
frame2.setSize (500, 500);
JButton button = new JButton ("Button");
button.addActionListener (new ActionListener() {
@Override public void actionPerformed (ActionEvent e) {
frame2.setVisible (true); } });
JFrame frame = new JFrame();
frame.add (button); frame.setSize (500, 500);
frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
frame.setVisible (true);
}
}