You could try something like what I did in the following actionPerfomed method.
If you read the API, setAlwaysOnTop is not honored on all platforms.
Or by my girlfriend, but that's another story...
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class RevealExample implements Runnable, ActionListener {
private JFrame f;
private Timer timer;
public void run() {
f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setSize(500,400);
f.setLocationRelativeTo(null);
f.setVisible(true);
timer = new Timer(5000, this);
timer.start();
}
public void actionPerformed(ActionEvent evt) {
if ((Frame.ICONIFIED | f.getExtendedState()) != 0)
f.setExtendedState(Frame.NORMAL);
f.setAlwaysOnTop(true);
f.setAlwaysOnTop(false);
timer.stop();
}
public static void main(String[] args) {
EventQueue.invokeLater(new RevealExample());
}
}
Hmm, it seems as though this is definitely related to XML-RPC... I'm running a Java XML-RPC server thread which recieves a method call from a PHP XML-RPC client. Basically, the method call needs to change some data and bring the Java application to the foreground of the visible windows in the operating system. However, it seems that the method just dies, and doesn't do anything whenever I attempt to play around with any kind of JFrame display settings. Very strange.. has anyone come across this before?