March 20, 1997

Passing a Method to Another Class to be Called By That Class

Question: Is it possible to pass a method to another class,so that method can be called by that class at a later date?For example, in C you can pass an event handler to afunction, and that handler can be later called by that function if aspecific event occurs. Answer: This

Difference Between ‘float’ and ‘Float’ Types

Question: What is the difference between the types’float’ and ‘Float’ in Java? Answer: A variable of type float contains an IEEE single precision number,while a variable of type Float contains a pointer to an objectencapsulating an IEEE single precision number.The class Float is called an object wrapper of the typefloat.The

Creating Applet to Ping IP Address

Question: I would like to create a very simple applet that pings anIP address and returns a message stating whether that IP is alive. Icouldn’t find any straightforward answers to my problem in thejava.netpackage. How can I create a program with Java that performs this task? Answer: I created a

Creating a Dialog Box

Question: I’ve been to sites where dialog boxes appear. How can I create one?I also want to ask users for their names, and then to be able to tell how many timesthey have visited my site. Answer: Creating a dialog box in Java is fairly straightforward if youaren’t interested in

Why doesn’t the window.close() method always work?

Question: Why doesn’t the window.close() method always work? Answer: In JavaScript 2.0, the window.close() method could be used to close any open browser window. People being the malicious animals that they are, the window.close() command was exploited in practical jokes. With JavaScript 2.0, jokers were able to rig their Web

How do I implement classic algorithms in C?

Question: Where can I find algorithms and data structures, techniques and programs that will better show me how they can be implemented using ANSI C? Other areas include Hashing, Heaps, Queues, and Binary trees, etc. Answer: Here are two highly recommended books for this topic: Sedgewick, Algorithms in C and

Creating TextField to Handle Passwords

Question: How do I create a TextField that handles a password?What are the KEY_ACTION events associated with it? Answer: The setEchoCharacter() method within the TextField class allows youto do precisely that. It lets you specify the character that isto display on the screen within the textfield area when the usertypes

Using Java to Control System Functions

Question: I would like to be able to browse my server and havean applet/program that would mimic the functions of,say, the control panel on a Macintosh.Would I needto write a custom browser to be able to do this?Also,I would like to be able to have the server check theversion of

No more posts to show