File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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
It's not a secret anymore!