By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,797 Members | 1,336 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,797 IT Pros & Developers. It's quick & easy.

toFront() Problem

P: n/a
I've got some code that I'm sure used to work, but now running with
1.4.1_01 on a Windows XP system, the toFront() method doesn't bring
the window on top of other native windows any longer. Any ideas why?
The "Got Here" message reliably displays every ten seconds.

javax.swing.Timer timer;

SomeOptionDialog()
{
super((JFrame)null, "Choose Startup Options", true);
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE) ;
...
...
pack();
setLocationRelativeTo(null);

timer = new javax.swing.Timer(0, this);
timer.setDelay(10000);
timer.setInitialDelay(0);
timer.start();
//Note: .show() is now invoked from the class that created this
dialog
}

public void actionPerformed(ActionEvent ae)
{
if (ae.getSource() == timer)
{
System.err.println("Got Here");
toFront();
}
else
{
timer.stop();
setVisible(false);
}
}

Bill Dennis
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.