I want to build Java Applet without using an IDE

I was asked to make a Java Applet in class, but NetBeans is recommended. I didn't like an IDE that I wasn't used to. So I wanted to make Java Applet with VS Code, so I will summarize the knowledge at that time I don't know about Linux because it is written on the premise of Windows.

~~ Or rather Java Applet is no longer recommended, right? ?? ?? ?? ~~

1: Write code

--Import what you need

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

――Various things

public class CLASS_NAME extends Applet {

    public CLASS_NAME() {
    }

    public void paint(Graphics g) {
        //Make various
    }
}

** (This is not the main subject) **

2: Compile

Launch command line

The location of the java file for the cd source
javac source.java

3: Create an applet-based HTML file

<html>
<head><title>Applet Test</title></head>
<body>

<applet code="CLASS_NAME.class" width="150" height="150">
</applet>

</body>
</html>

It seems that this file name does not matter (I am troublesome, so I use applet.html by changing only the class name)

~~ 4: Place the two files created as follows ~~

folder --- Applet.html
        |
        -- Classes(folder) --- CLASS_NAME.class

2018/11/30 Correction: When codebase is specified in the above html, it seems to be useless unless it is in that folder, but if you remove codebase, it will be the working folder as it is It looks like you can hit it </ font>

5: Run the applet

On the command line

 appletviewer Applet.html

If there is no error with this, it succeeds If you get an error, check the folder location, class name, and cd location.

Thank you for your hard work.

~~ It's the second time, but Java Applet isn't stupid now ????? ~~

Recommended Posts

I want to build Java Applet without using an IDE
I want to use Java Applet easily on the command line without using an IDE
I tried to build an environment using Docker (beginner)
I just want to write Java using Eclipse on my Mac
I want to make an ios.android app
Map without using an array in java
I want to stop Java updates altogether
I want to ForEach an array with a Lambda expression in Java
[In-house study session] Java basics-execution without using IDE- (2017/07/06)
Run R from Java I want to run rJava
I want to use java8 forEach with index
rsync4j --I want to touch rsync in Java.
I want to write quickly from java to sqlite
I installed WSL2 without using Microsoft Store and tried to build an environment where Docker can be used
[Java] I want to calculate the difference from the date
[Java 11] I tried to execute Java without compiling with javac
I tried to operate SQS using AWS Java SDK
I want to use ES2015 in Java too! → (´ ・ ω ・ `)
I want to judge the range using the monthly degree
I want to transition screens with kotlin and java!
I tried using an extended for statement in Java
I want to call the main method using reflection
Try to build a Java development environment using Docker
I want to get along with Map [Java beginner]
I want to return an object in CSV format with multi-line header & filter in Java
I want to implement it additionally while using kotlin on a site running Java
[Java] I want to convert a byte array to a hexadecimal number
I want to find a relative path in a situation using Path
I want to convert characters ...
I want to push an app made with Rails 6 to GitHub
I want to write a loop that references an index with Java 8's Stream API
I want to make a list with kotlin and java!
[Java] I want to write asynchronous processing using Promise in Java-Trial of Promise-like grammar of JavaScript-
I want to make a function with kotlin and java!
I want to use the Java 8 DateTime API slowly (now)
What happened in "Java 8 to Java 11" and how to build an environment
[Rails] I want to display "XX minutes ago" using created_at!
I tried to build the environment little by little using docker
Even in Java, I want to output true with a == 1 && a == 2 && a == 3
I want to manually send an authorization email with Devise
I tried using Java REPL
I tried using Dapr in Java to facilitate microservice development
I want to implement various functions with kotlin and java!
[Java] I want to test standard input & standard output with JUnit
I made a Dockerfile to start Glassfish 5 using Oracle Java
I want to simplify the conditional if-else statement in Java
I want to convert an array to Active Record Relation with Rails
I want to return to the previous screen with kotlin and java!
[Ruby] I want to put an array in a variable. I want to convert to an array
I tried to build an http2 development environment with Eclipse + Tomcat
I really want to do "new T ()"! (And without inspection exceptions)
I tried to build a simple application using Dockder + Rails Scaffold
I tried to make an Android application with MVC now (Java)
I tried to make it an arbitrary URL using routing nesting
[Java] I want to perform distinct with the key in the object
[Development log ⑮] I want to add an external link or PDF link
I tried to display the calendar on the Eclipse console using Java.
Swift: I want to chain arrays
I want to use FormObject well
I want to convert InputStream to String
I tried to interact with Java