wood burning stoves 2.0
The moose likes Beginning Java and the fly likes Layout Problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Layout Problems" Watch "Layout Problems" New topic

Layout Problems

Greg Roberts
Ranch Hand

Joined: Feb 05, 2005
Posts: 72
Okay, I am attempting to set up a GUI that looks like this:

I am creating a custom frame, and inside the frame I am building panels to house the components. The button at the bottom is in a panel, the JTextAreas in the middle are in a panel, and the display area at the top is in a panel. I am trying BorderLayout, adding the text areas to the center, but they are squeezed together, leaving blank spaces for east and west. Is there any way to either have the center panel expand (essentially removing east and west) or place the JTextAreas in east and west, but have them close in (removing center)?

Or should I throw out BorderLayout altogether and use something else?

Greg Roberts<br />CIS Student<br />University of West Florida
marc weber

Joined: Aug 31, 2004
Posts: 11343

One approach is to nest different layouts.

BorderLayout might be fine for establishing your top, center, and bottom regions. But in the center of this BorderLayout, you could add a single panel that uses a different layout Manager -- perhaps a GridLayout.

The following link should help...


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
Greg Roberts
Ranch Hand

Joined: Feb 05, 2005
Posts: 72
I pretty much worked out the display, now I'm on the hard part. I need to be able to open up a directory, rename some files in the directory, and write those files with their new filenames to some new directories. I've set up the JFileChoosers so they come up and only let the user select directories. Now I'm not sure how to proceed from here. The Java book we're using doesn't cover what I need here.

Here's what I've got so far. These are only the action listeners for the menu choices to select source and destination folders.

Ko Wey
Ranch Hand

Joined: Sep 08, 2003
Posts: 67
Following code should quiz the content of a directory
and show the non-directory files in the jtextarea
I agree. Here's the link: http://aspose.com/file-tools
subject: Layout Problems
It's not a secret anymore!