How to run Java frame over ssh

I have to run a java program which has a applet embedded within a Frame . I am doing this because I want to run applet as a application.

It works awesome when I run it on my local machine but It does not when I want to do it in remote machine. The program seems to be running my main () but I am not able to see the window.

I tried ssh -X and ssh -t but of no use.

Here is the test code

public static void main(String args[]){

        final DatingGUI applet = new DatingGUI();
        applet.init();
        applet.start();

        Frame frame = new Frame("RKY-Dating-Game Applet");
        frame.addWindowListener(new WindowAdapter()
        {
            public void windowClosing(WindowEvent e)
            {
                System.exit(0);
            }
        });

        frame.add(applet);
        frame.setSize(IDEAL_WIDTH,IDEAL_HEIGHT);
        frame.setVisible(true);
}

Any help is appreciated.

Thank you.


Well , I figured out. The plugin x11 was missing in my Mac. I installed it and the issue was fixed.

链接地址: http://www.djcxy.com/p/23862.html

上一篇: serialVersionUID用于serizlizable类

下一篇: 如何通过ssh运行Java框架