How To Make Window Stay On Top ?
4 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   asad_razvi
Posted On:   Friday, April 13, 2001 03:13 PM

How can I make a Window or Frame stay on top of all other windows?

Re: How To Make Window Stay On Top ?

Posted By:   Mike_Aizatsky  
Posted On:   Wednesday, June 13, 2001 01:45 AM

Try the following piece of code. It won't work under Windows 2000 because toFront() works in another way (task bar flashes). Under other platforms it should be ok.





import javax.swing.*;
import java.awt.event.*;

public class OnTop extends JFrame
{
public OnTop()
{
setSize(100, 100);
setLocation(100, 100);

addWindowListener(new WindowAdapter()
{
public void windowDeactivated(WindowEvent e)
{
toFront();
}
});
}

public static void main(String[] args)
{
(new OnTop()).setVisible(true);
}
}

How To Make Window Stay On Top ?

Posted By:   Scott_Stanchfield  
Posted On:   Tuesday, May 22, 2001 04:01 AM

Please search the AWT and Swing FAQs regarding this question.

Re: How To Make Window Stay On Top ?

Posted By:   Luigi_Viggiano  
Posted On:   Sunday, May 6, 2001 06:24 PM

Only using a native api, I believe.

Re: How To Make Window Stay On Top ?

Posted By:   Sandip_Chitale  
Posted On:   Tuesday, April 17, 2001 09:09 AM

Use non-modal Dialog or JDialog with
your application Frame/JFrame as the parent.
About | Sitemap | Contact