Layout Managers

Java AWT CardLayout Manager

After learning the basic layout managers (Flow, Border and Grid), let us study the advanced layout managers – CardLayout and GridBagLayout. These two managers are used in specific cases, but not often, where basic layout managers with panel combinations fail to fulfill the layout requirements. Layout management is the procedure of deciding the size and …

Java AWT CardLayout Manager Read More »

Draw Smiley Face Java Nested Panels

1. Creating Smiley Face This tutorial, "Draw Smiley Face Java Nested Panels", gives command over graphics to a novice. Fill ovals and arc are arranged in such way it looks smiley face. For beautification, a background color of pink (predefined color) is given. Example on Smiley Face import java.awt.*; public class SmileyFace extends Frame { …

Draw Smiley Face Java Nested Panels Read More »

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 is BorderLayout and for Panel …

Java No Layout Manager setBounds() Read More »

Java AWT Panels

Java AWT Panels play a very important role in layout management. Panels in combination with layout managers render the desired layout to the programmer. Following hierarchy gives the place of Panel in AWT API. java.lang.Object –> java.awt.Component –> java.awt.Container –> java.awt.Panel –> java.applet.Applet Properties of Java AWT Panels As you can see from the hierarchy, …

Java AWT Panels Read More »

Java AWT GridLayout Manager

After knowing the importance of layout managers, FlowLayout and BorderLayout, let us study the other layout manager – GridLayout. As the name indicates the container is divided into a grid of cells dictated by rows and columns. Each cell accommodates one component. Like with FlowLayout, in GridLayout also, the position need not be mentioned. But …

Java AWT GridLayout Manager Read More »

BorderLayout Manager Example

BorderLayout Manager Example: After knowing the layout managers, FlowLayout and GridLayout functionality, let us go to the style of BorderLayout arrangement of components in a container. As the name indicates the container is divided into 5 regions – 4 borders (North, South, East, West) and 1 Center. Following are the properties of BorderLayout manager. Components …

BorderLayout Manager Example Read More »