Tuesday, 17 May 2016

How to Run Java Applets and Swing Using Command Line

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

How to Run Java Applets and Swing Using Command Line


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



You May Also See


1. Java Program To Find Area Of Triangle

2. Java Program to Convert a person's name in Abbreviated

3. Java Program For Calculate A Simple Interest

4. Java Program For Find The Gross Salary Of An Employee

5. Java Program For Converting Temperature Celsius Into Fahrenheit

Extreme Recommended:- Like our Facebook Page or Join our Facebook Group and Google plus Community for up-to-date. If you have any Query or Question you can ask in the group, I will Try To Solve your Query and try to answers of your Questions withing 24 Hours, You can also Email me or comment below Please suggest to your Friends to join and like our page and don't forget to Subscribe. Enter your Email and click to subscribe.

Ghanendra Yadav

Ghanendra Yadav

Hello, I Am Ghanendra Yadav Owner of This Blog, I am professional Blogger and Programmer. I Love Programming, Logo Making, And Banner Designing. My Highest Qualification is MCA From NIT Warangal. You Can Find Me On Social Media Through Below Link And If You Have Any Query Related To Programming And Other Subject Comment Below or You Can Mail Me I Will Try To Answer Within 24 Hours Email:- yghanendra@student.nitw.ac.in

Find me on Social Media

Facebook | Twitter | Google+ | RSS Feed

2 comments:

  1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from Java Training in Chennai. or learn thru Java Online Training in India . Nowadays Java has tons of job opportunities on various vertical industry.

    ReplyDelete