Q:

How to Run Java Applets and Swing Using Command Line

0

Problem:- Compiling and Running Swing Programs or Compiling and Running Swing Programs or How to run the applet from a command line? or how to run awt (Abstract Window Toolkit) program in command prompt or how to run java swing program using cmd or how to run java awt (Abstract Window Toolkit) program in cmd or How to Run Java Applets and Swing Using Command Line or How To Run Applet/Swing Programs In JAVA Using Command Prompt.

Explanation:- There are only 5 steps, follow all step by step. I am sure after following these step your AWT (applet and Swing) programs will definitely run in the browser.

Extreme Recommended:- Like our Facebook Page or Join our Facebook Group and Google plus Community for up-to-date for a new post or if you have any Query you can ask there with lots of coders also suggest to your Friends to join and like our page

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Step 1: Press WIN+R one popup will open (as you can see in below picture) in left bottom corner Type " CMD " and hit enter from the keyboard and go to next step 2.

How to Run Java Applets and Swing Using Command Line
 
Step 2: Now go to your program location with the help of "cd " command enter the folder name or Path Name or Directory Name As you can see here my program is located in C:\Users\GHANENDRAY\Desktop\Docs\assignment\Java lab\RUNNING ASSIGNMENT. This is my directory of the program where my program is saved. In case of your directory may be different. Go to Step 3.
How to Run Java Applets and Swing Using Command Line
Step 3: After following the step 1 and step 2  you are in program directory here Type this command " javac filename.java " and press enter where filename.java is the program name and javac for compiling a program. Wait for a moment until your program in compiling.
How to Run Java Applets and Swing Using Command Line
Step 4: Now if your program compiled successfully then no error will occur if there is an error in the program all errors will be shown so first fix all these errors and again Type "appletviewer filename.java" and hit enter. Here applet viewer is used to run the applet program as you can see below.
How to Run Java Applets and Swing Using Command Line
Step 5: This is the last step here a new popup window occur and display the output of your program. As you can see in my case program is ready for work as shown below. 

How to Run Java Applets and Swing Using Command Line

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Bouncing Ball Program in Java Using Applet... >>
<< Java Calculator Program Using AWT & Applet...