Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: Summary - GUI Layouts 2 - BoxLayout, CardLayout, GridbagLayout

Layout, layo, becomes that layout manager for container p (a JPanel or Container) with the following.

Tutorial Details:

Layouts (BoxLayout, CardLayout, GridbagLayout)
BoxLayout, Box - Lays out components in single row or col. Add "glue" and rigid areas to control spacing.
boxl = new BoxLayout(p, dir); Creates layout for container p. dir is BoxLayout.X_AXIS BoxLayout.Y_AXIS. Note: must have already created p.
box = new Box(dir); Creates a Container with vertical or horizontal layout.
p.add(widget); Adds widget to the next position.
These static Box methods create useful spacing components, which can be used in other layouts.
Box.createVerticalStrut(n) Creates a vertical spacer n pixels high.
Box.createHorizontalStrut(n) Creates a horizontal spacer n pixels wide.
Box.createRigidArea(dim) Spacer with width and height. dim is Dimension object, eg, new Dimension(10, 0).
Box.createHorizontalGlue() Creates expandable horizontal space.


 

Rate Tutorial:
http://www.roseindia.net/java/java-tips/summaries/guisum-layouts2.shtml

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
Summary - GUI Layouts 2 - BoxLayout, CardLayout, GridbagLayout

View Tutorial:
Summary - GUI Layouts 2 - BoxLayout, CardLayout, GridbagLayout

Related Tutorials:

StringBuffer versus String - JavaWorld March 2000
StringBuffer versus String - JavaWorld March 2000
 
Dynamic user interface is only skin deep - JavaWorld May 2000
Dynamic user interface is only skin deep - JavaWorld May 2000
 
JSP best practices
Follow these tips for reusable and easily maintainable JavaServer Pages
 
Flex your grid layout
Flex your grid layout
 
UI design with Tiles and Struts
UI design with Tiles and Struts
 
The J2EE 1.4 Tutorial
The J2EE 1.4 Tutorial is a guide to developing enterprise applications for the Java 2 Platform, Enterprise Edition (J2EE) version 1.4. Here we cover all the things you need to know to make the best use of this tutorial.
 
Excellent tutorial on Struts and Tiles
Excellent tutorial on Struts and Tiles This tutorial assumes knowledge of Java, JDBC, Servlets, J2EE (with regards to Web applications) and JSP Struts in a holistic manner, minus the beads and crystals. The Tiles framework makes creating reusable pages
 
JGraph - The Java Graph Diagram Component
JGraph - The Java Graph Diagram Component JGraphAddons is a drop-in functional module that adds powerful and configurable layout algorithms to your existing JGraphs. They include hierarchical, circular and tree layouts capable of giving your JGraph app
 
JDBC scripting, Part 2
JDBC scripting, Part 2 Programming and Java scripting in JudoScript Summary JudoScript is a rich functional scripting language, and an easy and powerful general programming and Java scripting language. JudoScript's power comes from its synergy of
 
J2EE security: Container versus custom
Choose the appropriate type of security for your application Summary This article covers the factors to consider when choosing between custom J2Esecurity and E standard security, also known as container security. It briefly covers how each type of secu
 
HA-JDBC: High-Availability JDBC
HA-JDBC: High-Availability JDBC Summary HA-JDBC is a JDBC driver proxy that provides light-weight, transparent clustering capability to any underlying JDBC driver.
 
Classifier4J
Classifier4J is a Java library designed to do text classification. It comes with an implementation of a Bayesian classifier, and now has some other features, including a text summary facility.
 
Solving the logout problem properly and elegantly
Summary Properly handling the logout process in a password-protected Web application requires more than just calling the invalidate() method on the HttpSession object because most modern browsers, with the Back and Forward buttons, allow users to go back
 
Build scripts with Groovy and Ant
Build scripts with Groovy and Ant Summary In nearly all developers' toolboxes, Ant is the standard build tool for Java applications, thanks to its open, standard, and multiplatform structure. Though it represents a great improvement in automating produc
 
JFindReplace
JFindReplace is a "find and replace" swing component working with various options (regulation expression, incremental mode...) and standard text components like JTextArea, JTextPane, JEditorPane....
 
Gain SQL SELECT functionality in Java
Gain SQL SELECT functionality in Java Summary In "Filter Collections," David Rappoport described a simple way to filter collections of objects. In this article, he expands on this idea and shows you how to treat an array or a collection of objects the s
 
JDock 1.1 - Swing docking framework
JDock is a pure java swing framework for managing, moving and resizing inner windows or components using a layout manager like a BorderLayout or a GridBagLayout.
 
Reuse Tiles and Simplify UI
JavaServer Pages (JSP) technology supports application object reuse through includes, which allow other files (including other JSPs) to be sourced into a JSP file either at compile time or dynamically at application runtime. This is great for abstracting
 
Asprise OCR Java SDK v2.1
Asprise OCR Java SDK enables you to equip your Java applications (Java applets, web applications, standard applications, J2EE enterprise applications) with optical character recognition ability.
 
Developing Simple Struts Tiles Application
Developing Simple Struts Tiles Application Developing Simple Struts Tiles Application Introduction In this section I will show you how to develop simple Struts Tiles Application. You will learn how to setup the Struts Tiles and create example
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.