Note that there are some explanatory texts on larger screens.

plurals
  1. POJava applet works in eclipse, not anywhere else
    text
    copied!<p>I'm brand new to java and have tried to get this to work for the last 48 hours and I'm about to give up.</p> <p>I want to put the java applet on a website. Works fine only in eclipse. I tried many solutions already suggested on this site and none of them worked for me and just mucked up the code so I've reverted it to my original state. Could anyone pinpoint the problem? Thanks!</p> <p>(code edited to reflect suggested answers)</p> <pre><code> package nameapp; import java.util.*; import java.io.*; import java.applet.Applet public class NameApp extends Applet{ public static void main(String[] args) throws IOException { String name; BufferedReader reader; reader = new BufferedReader(new InputStreamReader(System.in)); System.out.println("What is your name? "); name = reader.readLine(); if (name.equals("Mike")) { System.out.print("Hello it's "); System.out.println(new Date()); System.out.print("My name is "); System.out.print(name); System.out.println(" and I am totally awesome!!!"); } else if (name.equals("Lisa")) { System.out.print("Hello it's "); System.out.println(new Date()); System.out.print("My name is "); System.out.print(name); System.out.println(" and I'm the prettiest gal in the world!"); } else { System.out.print("Hello it's "); System.out.println(new Date()); System.out.print("My name is "); System.out.print(name); System.out.println(" and I'm just ok i guess..."); } } </code></pre> <p>}</p> <p>And html is...</p> <pre><code> &lt;applet code=nameapp/NameApp.class width=300 height=300&gt; &lt;param name="bgcolor" value="ffffff"&gt; &lt;param name="fontcolor" value="000000"&gt; Your browser is not Java enabled. </code></pre> <p></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload