Home > Store > Programming > Java

larger cover

Add To My Wish List

Register your product to gain access to bonus material or receive a coupon.

Java 2 From Scratch

Book

  • This product currently is not for sale.
Not for Sale
  • About
  • Description
  • Downloads
  • Extras
  • Updates

FAQs

Question 1: How can I get a function of getting an HTML page (InternetManager.class) to function in an applet and have access to an HTML page?

Solution 1: The problem you are having is with respect to Java's sandbox security model. By default an applet can only read from server that it was downloaded from - so if your URL is:

http://www.mycompany.com

Then your applet can only make a socket connection (or URLConnection) back to www.mycompany.com.

The solutions to this are either:
(1) Make the connection on the backend (e.g. inside a servlet) and pass the results to your applet

(2) Modify the security settings to permit your applet to communicate with other servers (I haven't done this in years so I don't recall off hand how to do that - I can look it up if you are interested), but the problem is that each of your customers will have to adjust their browser settings to trust all applets with more privileges than they probably should. Unless this is an Intranet applet I would not recommend this approach.

So my suggestion is to make the URL connection from your web server's backend - either servlet or create your own server that your applet can talk to (see the java.net.ServerSocket class for more information on developing a server).



Question 2: Where is the Source code, FAQ, and related materials for this book?

Solution 2: As part of the author's ongoing effort to support his books, He now offers a FAQ, source code and related materials on his web site: http://www.LibertyAssociates.com. Please click on books & resources. While you are there, you may want to sign up for his on-line support discussion center:
http://www.delphi.com/LibertyBooks



Question 3: This book says that the Java Development Kit is included on the CD. Appendix A is "Setting up the Java 2 SDK" and says that there should be a file JDK1_2_1-win.exe on the CD which is the installation for the Java Development Kit. However, it is not there.

Solution 3: Appendix A refers to the installation of the Java 2 SDK, which is not included on the CD-ROM but is available at no charge from Sun Microsystem's website at the following URL:

http://java.sun.com/products/jdk/1.2

We did not include the JDK with the book as the versions change frequently, but in chapter 1 (page 9) there is a section "So How Do I Get Started" that points you to this URL.

If you do not have access to the internet and are unable to download the JDK, then we do have a CD that we could send to you, that contains JDK 1.2. If you'd like to have the CD, send a return email and include your name, mailing address, and telephone number.

If you'd rather get a book refund, contact Customer Service at 800-858-7674.



  • Copyright 1999
  • Dimensions: 7.375 X 9.125
  • Pages: 704
  • Edition: 1st
  • Book
  • ISBN-10: 0-7897-2173-2
  • ISBN-13: 978-0-7897-2173-0

Java 2 From Scratch walks you through the analysis, design and implementation of a functioning application using Java 2. Learn all the critical programming concepts and techniques associated with the language in the context of creating a functioning Stock Market Tracker/Analyzer. Each chapter builds on the previous with a casual tone, in-depth examples, and detailed steps to ultimately create a working stock market tracker. Key areas addressed are user interface design, SWING user interface, Internet communication, file I/O, painting/drawing, and brief introductions to JDBC and RMI.

Source Code


Source Code

Corrected source code from chapter 9 - 5.43kb -- ch9fix.zip

Corrected source code from chapter 10 - 6.61kb -- ch10fix.zip

FREE

ONE MONTH ACCESS!

WITH PURCHASE


Get unlimited 30-day access to thousands of Books & Training Videos about technology, professional development and digital media If you continue your subscription after your 30-day trial, you can receive 30% off a monthly subscription to the Safari Library for up to 12 months.