hi there guys.Can anione please show me how to create a always on top frame.(no native methods)

Sounds easy, but...

Two options :
A] Use Java2 Version 1.5. The option seems to be included there.
B] Use a WindowListener handler for the WindowDeactivated event and call the toFront() method there. However, this seems to only work for your own (java-generated) frames/windows but not for other apps windows; they can still cover your frame.

The second option goes something like :

public class AllWaysOnTop extends JFrame implements WindowListener {

        AllWaysOnTop() {
            ... Code to setup your frame
            addWindowListener(this);
            ... Code to show your frame
        }

        // The window event handlers. We use WindowDeactivated to
        // try and keep the splashscreen on top. Usually only keeps
        // the splashscreen on top of our own java windows.
        public void windowOpened(WindowEvent event){};
        public void windowActivated(WindowEvent event){};
        public void windowDeactivated(WindowEvent event){
            toFront();
        }
        public void windowIconified(WindowEvent event){};
        public void windowDeiconified(WindowEvent event){};
        public void windowClosed(WindowEvent event){};
        public void windowClosing(WindowEvent event) {};
    }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.