Supporting Classes

HeadlessException

HeadlessException Summary: By the end of this tutorial you will come to know the possibility of raising HeadlessException by JVM. It falls under the category unchecked exception. This runtime exception is thrown when the code that is dependent on the hardware like keyboard, display, or mouse is called in an…

Java Component Preferred Size

To develop user friendly and good look environment, the layout of the components in a container is very important to the programmer like the selection of colors and fonts for graphics. The user should feel free and comfortable to stay some time in GUI. To give attractive graphical user interface…

Borderless Frame pack()

Borderless Frame pack() Summary: By the end of this tutorial "Borderless Frame pack()", you will understand how to create a borderless frame and pack() method. 1. Creating a borderless window Frame is known as top-level window as it contains border and title bar (panel is not a top-level window; it…

Java repaint() Call paint()

The paint() method is called by the JVM implicitly in two circumstances. One is when the first time frame is created and displayed. The other is when the frame is resized (by dragging the frame border with mouse) by the user. If the programmer would like to call the paint()…

Java No Layout Manager setBounds()

We know earlier in "Java Layout Managers" that two styles of placing components in containers – pixel format and position format. Now let us discuss clearly what pixel format is and how to place a component in terms of pixels. We also know earlier, the default layout manager for Frame…

Java AWT Create Font Object

Important text can be made eye-catching by displaying in attractive fonts. A font represents a combination of a font name (like Monospaced), font style (like bold) and font size (like 20). Following is the class signature public class Font extends Object implements Serializable The Font constructor takes three parameters to…

Java AWT Create Color Object

With colors and fonts, readability increases as important noteworthy topics can be colored. All the latest operating systems support colors and fonts and allow customizing also. To support colors and fonts, the java.awt package includes Color class and Font class. Standard Color Models Color can be specified in two formats…