Run Java-applets directly ( without html page )

前端 未结 7 1221
一向
一向 2021-01-05 15:58

I have a problem.

How i can run my java-applet directly without embedded in my web page?

I know appletViewr can execute applet without a browser but I need

相关标签:
7条回答
  • 2021-01-05 16:09

    Appletviewer is the way to go, BUT, it still requires a webpage with an applet-tag.

    An alternative solution is to write a stub class, with a main method, that instantiates the applet, calls init(), start(), stop() and destroy() as would otherwise have been done by the browser or appletviewer.

    0 讨论(0)
  • 2021-01-05 16:09

    If you use eclipse: Right-Click on your main java file (the one which extends Applet), select the 'Run As' submenu, and select 'Applet.

    0 讨论(0)
  • 2021-01-05 16:15

    Use /*<applet code="java file name " height=150 width=150></applet>*/ before declaring applet class and then compile java program and run applet by using appletviewer it execute perfectly don't require any html file

    0 讨论(0)
  • 2021-01-05 16:30
    <applet code=classname height=200 width=200>
    
    </applet>
    

    Simply write this code in your java program and first run using:

    javac classname.java
    

    after

    run:appletviewer classname.java
    
    0 讨论(0)
  • 2021-01-05 16:32

    Build a subclass, which implements main-method, and call init(), start(), stop(), destroy as needed.

    0 讨论(0)
  • 2021-01-05 16:33

    Run appletviewer [ options ] urls ...

    Documentation

    0 讨论(0)
提交回复
热议问题