<HTML>
<HEAD>
</HEAD>
<BODY>
<APPLET
Code = WelcomePage.class width=300 height=300>
</APPLET>
</BODY>
</HTML>

Dani AI

Generated

This thread mixes two different problems: the applet markup posted by (and the markup hint from ) and the separate command‑line run reported by . Quick, practical checks that solve the vast majority of “no output” cases follow.

For the applet case: make sure the compiled class is actually reachable by the HTML (same folder, correct codebase, or inside an archive/JAR). If the class is declared inside a package, the class file must live in the matching subfolder and you must reference the fully qualified name. Also confirm the applet actually draws something (overrides paint/adds components) instead of only calling System.out.println (that won’t show in the page). Browsers often hide plugin errors — use the Java Console or the JDK tool appletviewer so you see exceptions and classloader errors:

javac MyApplet.java
appletviewer mypage.html

For a plain console program (the “Test” main reported by ): compile with javac, run with java (without the .class extension), and be sure you run from the directory that contains the class or the package parent. Check that the JDK/JRE on PATH is the one you expect:

javac MyProgram.java
java MyProgram
javac -version
java -version

Common gotchas: running the .class by double‑clicking (no console), mismatched package vs. folder, filename not matching a public class, and using a different JRE/JDK than the one used to compile.

One more reality check: applets are obsolete in modern browsers (the Java browser plugin/NPAPI is no longer supported). For reliable testing use appletviewer and for new work consider a standalone application or a web alternative. See the applet obsolescence notes on MDN and the OpenJDK deprecation discussion (, JEP 289).

Recommended Answers

All 6 Replies

Did you get any errors?

and we're supposed to know this without knowing what you have in that class?

commented: He is just super confident in his java ability, there cannot be anything wrong with his code! +1

Need the Java code to be able to help you mate.

Member Avatar for Member #887084

For starters...HTML does not like spaces.

<applet code="WelcomePage.class" width="300" height="300"></applet>

sir i am trying to run this code in cmd prmpt but iam not getting any output displyed ,,but no error is also coming pls help me out ,,
my code is;
class Test
{
public static void main (String args[])

{
System.out.println(" i like java ");

}

}

Please do not hijack old post...

Also, how did you use your command line to run it? How did you compile your code?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.