This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Java in General and the fly likes Components Placement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Components Placement" Watch "Components Placement" New topic

Components Placement

Karl Nilsson

Joined: Jan 06, 2004
Posts: 14
hey, i need to know if there is a layout (other than in canvas) that allows the programmer to specify the placement of components by setting it a pair of coordinates
i know flowlayout is the default layout, and that doesn't do it
is a canvas my only option?
the reason i'm saying this is i started learning java a little while ago, but am still used to using VB and having no layouts, just coordinates

Why don't you just go into your home?<br />are you too good for your home, ball?!?
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
In the AWT you can use Panel to hold components. In Swing use JPanel or JComponent.

Null layouts, Absolute Positioning in the java tutorial, is the least used/fun layout (check what happens when you resize the frame) but sometimes nothing else will do. setBounds is the key.
I agree. Here's the link:
subject: Components Placement
Similar Threads
Grid for Coordinates
positioning the lable in palm's screen using j2me??
custom Layout Managers
Move a image in PDA