Java如何使自己的程序的窗口处于屏幕的最上层?象Flash Get那样?
或者给一个设计的思路

解决方案 »

  1.   

    补充一下,JDK1.4下如何实现;
    (1.5有接口了)
      

  2.   

    如果是我的话一定:
    反编译jdk1.5找相关接口源码。
      

  3.   

    JNI调用WinAPI
    HWND FindWindow(LPCTSTR LpClassName,LPCTSTR LpWindowName)  //获取窗口句柄
    BOOL SetWindowPos(HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags)  //设置窗口显示层次我写过这样一个dll,你不想写就留个邮箱,我给你发去
      

  4.   

    用JWindow写一个类似Flash Get小窗口大小的Window。
    为此Window添加鼠标双击事件,当鼠标双击时。显示另外一个主窗口JFrame。
      

  5.   

    建议还是用JDK1.5以上:import java.awt.*;
    import javax.swing.*;public class F
        extends JFrame
    {
        public F()
        {
            this.setUndecorated(true);
            this.setSize(60,60);
            this.setAlwaysOnTop(true);
            this.setLocation(700,80);
            this.getContentPane().setBackground(Color.blue);
            this.setVisible(true);
        }    public static void main(String[] args)
        {
            F f=new F();
        }
    }
      

  6.   

    import java.awt.*;
    import javax.swing.*;public class F
        extends JFrame
    {
        public F()
        {
            this.setUndecorated(true);
            this.setSize(40,40);
            this.setAlwaysOnTop(true);
            this.setLocation(930,30);
            this.getContentPane().setBackground(Color.green);
            this.setVisible(true);
        }    public static void main(String[] args)
        {
            F f=new F();
        }
    }
      

  7.   

    jdk1.5可以实现?楼主教一下我啊?我很感兴趣!我只知道jdk1.6是可以的.
      

  8.   

    TO:hoverlees(好棒) 
    楼上都写了^_^