Programming Examples

Are you a Programmer or Application Developer or a DBA? Take a cup of coffee, sit back and spend few minutes here :)

Tag Archive for ‘GridLayout’

JScrollPane – Scrolling Text Grid Panel

Java Swing JScrollPane Example

Java Swing provides JScrollPane to give scrolling support for the lengthy documents. The document can be a text, html documents or it can be a set of controls arranged in a container.

This example uses a grid of 1000 text boxes. Since we cannot view all the text boxes in the frame window, we give this grid of text boxes to the JScrollPane. Swing’s Scroll Pane component provides vertical & horizontal scroll bars and, using those, the user can scroll the grid and view any text box in the grid. In our example, we number the text boxes in a sequential order.

Continue Reading →

AWT Grid Layout Manager Explained

Controls In AWT Grid Layout

1. Introduction to Grid Layout In Java, we can arrange the controls in rows and columns using Grid Layout Manager. For example in the calculator, the buttons are formed in grids. We can easily achieve this through Grid Layout Manager. Each controls in the grid holds same space. In other words, all the controls in this Layout have same dimensions. The Layout Manager arranges the controls Left to Right and […]

Continue Reading →