How does Eclipse run .java files as applets?

后端 未结 3 822
栀梦
栀梦 2021-01-20 01:02

I\'ve been trying to run a simple applet that I created from the command line. I tried just doing:

C:\\java Applet 

It obviously didn\'t w

3条回答
  •  青春惊慌失措
    2021-01-20 01:27

    Applet is a graphic component that extends Panel and has Applet context. It is not a big problem to emulate this environment. You just have to create application with main method that creates frame with border layout and puts applet in the center of this frame. This application should also implement applet context that provides API to retrieve parameters.

    As was mentioned by @Satya JDK has such utility named appletvieer that can be executed from command line. Eclipse can either use appletvieer directly or implement is own viewer as described above.

提交回复
热议问题