Java Answers Ask John Logo
Ask John · Java · Perl · CGI · Xara · Other · John

Make sure that you've checked the answers and the FAQs before you Ask a Question.

Professional consultancy and software development is available through my company Castle Amber. See also my personal website for some Java applets.

1 General Information

1.1 Which web sites have information on Java?

  • JavaSoft - JDKs and documentation
  • Java FAQ - The Java FAQ, maintained by Peter van der Linden

1.2 Which books do you recommend?

Java Network Programming
Elliotte Rusty Harold
O'Reilly & Associates, Inc. ISBN 1-56592-227-1
Very good book. The first edition I have is almost 2 years old so some parts might be outdated. The book has a lot of small examples and a clear overview of the functions used.
Advanced Techniques for Java Developers - proven solutions from leading Java experts
Daniel J. Berg & J. Steven Fritzinger
John Wiley & Sons, Inc. ISBN 0-471-18208-7
includes CD-ROM

Errata

This book gives a very good overview of the "new" things added to Java. JFC, Java Media, JavaBeans, RMI, JDBC, Servlets, JNI etc. I've used the JDBC and Threads chapters a lot. Nice book.

2 Graphics

2.1 How can I reload a fresh image

When you load an image into an applet the image is cached. According to the Java FAQ even turning off caching with setUseCaches(false) doesn't always work.

The following solution will, however. Create a new URL by adding a ? and a number to the image URL. Increase the number each time you require a fresh image (for example in your webcam applet).

I use the following code in my AmberCam webcam applet:

Date ts = new Date();
String strUrl = "http://www.somesite.com/webcam.jpg?";

try
{
    url = new URL(strURL + ts.getTime());
}
catch (MalformedURLException e) { /*-- do nothing --*/ }
The getTime() function returns the number of milliseconds since January 1, 1970, 00:00:00 GMT.

This solution has been added to the Java FAQ.


Ask John · Java · Perl · CGI · Xara · Other · John

© Copyright 1999 by John Bokma