Java Answers | |
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 Information1.1 Which web sites have information on Java?1.2 Which books do you recommend?Java Network ProgrammingVery 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 expertsThis 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 Graphics2.1 How can I reload a fresh imageWhen 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: The getTime() function returns the number of milliseconds since January 1, 1970, 00:00:00 GMT.Date ts = new Date(); String strUrl = "http://www.somesite.com/webcam.jpg?"; try { url = new URL(strURL + ts.getTime()); } catch (MalformedURLException e) { /*-- do nothing --*/ } This solution has been added to the Java FAQ. |
|
Ask John · Java · Perl · CGI · Xara · Other · John © Copyright 1999 by John Bokma |