Good afternoon everyone. I'm new to Java and currently in a class where I need to display (and test) my applet in a web browser using HTML code. I'm able to get the string of the test program to display on the browser, but not the actual window. I've placed the HTML inside a .html file in the same folder under the same class name as the program I'm trying to view, but am having no luck. The program compiles and displays the window when run through command prompt, but does not display in the browser. If anyone can point me in the right direction, I would greatly appreciate it! I've used my search engine tirelessly without luck.
Here is the HTML code I'm using (the string displays, but window does not):
Here is the program (I have a much longer program I'm trying to run, but decided to test a smaller one for debugging) - and thank you in advance!:
Don't try strange colours of code like that; some people can only read certain colours.
What Applet? You are trying to extend JDialog, not JApplet. Why are you trying to use applets at all? They are obsolete. What sort of course have you got on?
You can run an applet via an html file which you open with the appletviewer tool, but youi don't have an applet. You will have to give it a main method. You will find more about it in the Java™ Tutorials.
Don't use System.exit. It might work in a single‑threaded environment, but you are here multi‑threading, so it can damage the integrity of anything used by other code. Don't catch IllegalArgumentExceptions; you cannot correct the error in code still running.
I once met a man from Nantucket. He had a tiny ad
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop