HOW TO: CREATE AND RUN JAVA AWT APPLETS IN INTELLIJ IDEA

If you want create a new applet using awt library via IntelliJ IDEA then you will need to take several simple steps.

1. Start IntelliJ IDEA and create new project:
Press "Create New Project"
2. Choose "Java" and the rest of the settings can be left as default.
Press "Next" button
3. Next window leave empty, by default
Press "Next" button
4. Write name you project, and other by default

Press "Finish"

5. Create a new Java class in your project in "src" folder
enter name for new class
6. Copy/paste code to body of class

import java.applet.*;
import java.awt.*;

/** * Created by Aleksandr on 14.03.2017. */
public class AppletClass extends Applet{
    public void init(){
    }

    public void start(){
    }

    public void stop(){
    }

    public void destroy(){
    }

    public void paint (Graphics g) {

    }
}
7.Tell IntelliJ Idea you want to make an applet by right-clicking on the new class you created and selecting "Create 'className'"
8. Make sure that "Applet class" is selected, you'll be able to chose it's height and width
"Applet Parameters" section allows you to enter/set up parameters that will be accessible via .getParameter("newParameter");
Press "OK"
 9. Now simply hit run/debug and appletviewer.exe will launch your applet in a new window

Next time you may change parameter and other: Run->Edit Configurations... 

Comments

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. From your discussion I have understood that which will be better for me and which is easy to use. Really, I have liked your brilliant discussion. I will comThis is great helping material for every one visitor. You have done a great responsible person. i want to say thanks owner of this blog.
    Java training in Bangalore | Java training in Kalyan nagar

    Java training in Bangalore | Java training in Kalyan nagar

    Java training in Bangalore | Java training in Jaya nagar

    ReplyDelete
  3. We are a group of volunteers and starting a new initiative in a community. Your blog provided us valuable information to work on.You have done a marvellous job!

    python interview questions and answers
    python tutorials
    python course institute in electronic city

    ReplyDelete

Post a Comment