|
 |
BOOK: Java Programming 24-Hour Trainer by Yakov Fain
 | This is the forum to discuss the Wrox book Java Programming 24-Hour Trainer
by Yakov Fain; ISBN: 978-0-470-88964-0 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Java Programming 24-Hour Trainer by Yakov Fain section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
|
 |
|
|
 |
|

February 21st, 2012, 10:49 PM
|
Authorized User
|
|
Join Date: Jan 2012
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Lesson10
Hello All,
When I run my applet I get the text that I place in paint. However when I run the code below in a browser, I do not get anything but a blank white screen. I have my html file under the JRE System Library and my .java class in a default package. I am unable to run a simple applet in a browser. Thanks in Advance!
HTML Code:
<html>
<head>
<title>My First Web Page</title>
</head>
<body>
My Tic-Tac-Toe game is coming soon:
<APPLET code="HelloWorld.class" width="300" height="250" />
</body>
</html>
|

February 22nd, 2012, 08:53 AM
|
Authorized User
|
|
Join Date: Sep 2011
Location: uk
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re:Lesson10
Hi Luthios
Move your html file into the same location as your java class. The html code is looking for your java class in JRE System Library and that is not the location of your class.
You could also place you html code in the Lesson 10 folder and use the following in your html file replace the APPLET code with your class information.
Code:
<APPLET code="com.practicaljava.lesson11.TicTacToeApplet" codebase="./bin" width=350" height="400" />
The code is basically saying that the applet code is at com/practicaljava/lesson11/TicTacToeApplet.class and the place to look is /bin.
hope this helps
|

February 22nd, 2012, 10:47 AM
|
Authorized User
|
|
Join Date: Jan 2012
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks Wolverine. I tried the suggestion and got the same results. If I navigate to the file path I get a box with a red x in the browser.
|

February 22nd, 2012, 12:32 PM
|
Authorized User
|
|
Join Date: Feb 2012
Location: Romania
Posts: 30
Thanks: 5
Thanked 4 Times in 4 Posts
|
|
Hello Luthios,
I think you will run successfully the applet in a browser if you locate HelloWorld.class and move it in the same directory as your html file. HelloWorld.class is created by Eclipse from your HelloWorld.java, probably when you first run HelloWorld.java as Java Applet. In my case, I found it in the bin directory of my project path.
Hope this helps.
|

February 22nd, 2012, 02:38 PM
|
Authorized User
|
|
Join Date: Jan 2012
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Unfortunatley, it is in the same folder as the class and will not run.
|

February 22nd, 2012, 02:50 PM
|
Authorized User
|
|
Join Date: Feb 2012
Location: Romania
Posts: 30
Thanks: 5
Thanked 4 Times in 4 Posts
|
|
I guess this is a proof that distance learning cannot always replace successfully in-class, instructor lead training.
Sorry I coulnd't help...
|

February 22nd, 2012, 03:30 PM
|
Authorized User
|
|
Join Date: Jan 2012
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Your help is greatly apreciated! I am also checking other forums and when I find the answer I will post it here. I think there is something anal I am overlooking.
|

February 22nd, 2012, 04:14 PM
|
Authorized User
|
|
Join Date: Sep 2011
Location: uk
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Luthios
your browser is blocking the running of scripts or Active X controls?
|

February 22nd, 2012, 06:43 PM
|
Authorized User
|
|
Join Date: Jan 2012
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I have internet explorer 9 set to allow activex. If i did have them blocked IE9 will prompt me to allow blocked content. I tried in chrome as well and I still getting the same results.
|

February 22nd, 2012, 06:58 PM
|
Authorized User
|
|
Join Date: Jan 2012
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
ERROR: From Applet
Below is the error message that I am receiving when running the applet.
Quote:
Java Plug-in 10.1.0.8
Using JRE version 1.7.0_01-b08 Java HotSpot(TM) 64-Bit Server VM
User home directory = C:\Users\MyDirectory
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
Detected from bootclasspath: C:\\PROGRA~1\\Java\\jre7\\lib\\deploy.jar
|
|
Thread Tools |
Search this Thread |
|
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |
All times are GMT -4. The time now is 06:40 PM.
|