devxlogo

Tip Bank

TextField listeners

Question: I want to capture an event that signals a user’s completed update to a TextField. Answer: In general, a user will finish entering text in a TextField by pressing

Saving Panels with TextField?

Question: I am writing a presentation application and want to take a Panel and add TextFields and maybe Images to it. Is it possible to save this Panel with TextFields

Textediting functions in Java

Question: I’m trying to make a text editor in Java, andI want the editor to be able to make words and even pieces of words italic, bold, or underlined. It

Port information

Question: I need to take a port number as input froma user. How can I check if the port numberentered by the user is free and not beingused by any

Classes in sun.* packages

All the classes in sun.* that accompany the Sun JDK are provided assupport classes that are used to implement specific sets of functionalityfor the core JDK classes. The classes in

Converting a String into an int

The Java core API possesses a method equivalent to the C atoi() function in Java. The java.lang.Integer class contains a method called parseInt()which will convert a String into an int.

Generating Random Numbers

The java.util package contains a class called Random which you can useto generate random numbers. A Random object represents a repeatingpseudo-random sequence of numbers. You can either fetch the next

Array Reflection

The java.lang.reflect package provides an Array class through whichthe values of an array can be accessed. It is usually more effectiveto cast the array after it has been obtained through