devxlogo

Tip Bank

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

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 #,

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

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

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

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

Graphics.create()

Question: For what uses can the Graphics.create() method be used? Answer: There will be cases where you want to make a copy of a Graphics context and make some alterations

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