Tip Bank

DevX - Software Development Resource

The Graphics.create() method

The Graphics.create() method is a convenient way of creating a copy of a Graphics context. For example, you can use the Graphics.create() method if you want to make a copy

DevX - Software Development Resource

System information..

Question: I’d like to write a little program that determines the type of system one has. It would be able to report, among other things, processor type, system/bios type/ver #,

DevX - Software Development Resource

Canvas in a ScrollPane

Question: How can you make a canvas nonresizable? The canvas automatically resizes when the frame is resized. Answer: The default layout manager for java.awt.Frame is BorderLayout. BorderLayout will expand the

DevX - Software Development Resource

Mouse Event Handling

Question: How do I program the right mouse button to bring up a window or dialog box when I right-click on a particular button? Answer: All Java AWT components exhibit

DevX - Software Development Resource

Java Threads and Multiple Processors

Question: On a Windows NT box with multiple processors, will a multithreaded Java application get split between the processors automatically? Answer: This depends on the version and vendor of theJVM

DevX - Software Development Resource

Textfield focus

Question: I have a frame with a few textfields on it. How can I set the focus to the first textfield? Is there something like setFocus? Answer: A component can

DevX - Software Development Resource

Operator overloading

Question: Can you do operator overloading in Java? If so, how? Answer: Java does not as of yet support operator overloading, and there are no signs that it will ever