Applets

When I reload my applet my hidden canvas is shown directly! Why?
Answer: Put mycanvas.setVisible (false); in Start() rather than init()...
I want to be able to print debugging text messages during the whole applet s lifetime. Is there an
easy way to do that???
Q: I m a beginner in java. Right now i am doing an applet and i want to
write messages to the browser window for debugging purposes i.e. to
follow how the applet executes. Like when i m developing an C++
application i usually use lots of "couts" to check values and the
programs behavior. Is there an easy way to do things like that when
making a Java applet? For me it seems like everything happens in a
function called "paint(graphics g)" and that function is only called at
the beginning of the applet start. I want to be able to print text
messages during the whole applet s lifetime. Is there an easy way to do
that???
Answer: you d be better off doing a
System.out.println("the value is " + whateverValue);
This will show up in the java console. to see it in ie5, do View >Java Console, and in netscape4.7, do
Communicator >Tools >Java Console and it will pop up the java console window.
If you are doing it in appletviewer from dos, it will show up in the dos window you used to call
appletviewer.
 What are restrictions for applet?
Q: What are applets prevented from doing?
Answer: In general, applets loaded over the net are prevented from reading and
writing files on the client file system, and from making network connections
except to the originating host.
In addition, applets loaded over the net are prevented from starting other
programs on the client. Applets loaded over the net are also not allowed to
load libraries, or to define native method calls. If an applet could define
native method calls, that would give the applet direct access to the
underlying computer.
Q: I am writing an applet that will use images. I would like to ship out the images using a jar file
that contains all the images that the applet is going to use. I have seen a piece of code that does that
in the past, but I don t remember where.
Answer: by David Risner  The following is from:
http://developer.netscape.com/docs/technote/java/getresource/getresource.html
import java.applet.*; 
import java.awt.*; 
import java.io.*; 
public class ResourceDemoApplet extends Applet { 
file:///F|/a_jsite/350_tips/applets.htm (2 of 9) [2001 07 08 11:24:47]






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

java web hosting

 

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved