473,320 Members | 1,695 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Two layouts, one GUI ?

63
I currently created a GUI using the GridLayout in order to have JLabels and JTextFields side-by-side. However, below the button, I would like to have a FlowLayout or something to display the results of the calculation. Is it possible to have two layouts on one GUI?

public void actionPerformed(ActionEvent event){
String eventName = event.getActionCommand();

if (eventName.equals("calcPED")){

FlowLayout experimentLayout = new FlowLayout();
contentPane.setLayout(experimentLayout);

When I do the following, the JLabels and JTextFields appear disarranged after the button is clicked. Any suggestions ?
Nov 27 '08 #1
1 1898
Nepomuk
3,112 Expert 2GB
If you make a GridLayout of 1x2 (or an other layout, if you wish), put a JPanel in each and then put a GridLayout in the top one and a FlowLayout in the bottom one. That should do the job.

Greetings,
Nepomuk
Nov 28 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Dario de Judicibus | last post by:
I wish to create two simple layouts by using only HTML, CSS and the minimum JavaScript as possible. Layouts should be "elastic" (no fixed widths and heights) and cross-browser enabled. The first...
6
by: Tristan Miller | last post by:
Greetings. Can someone point me to a good source of nice, simple stylesheets, similar to the W3C Core Styles provided at http://www.w3.org/StyleSheets/Core/? I don't need anything fancy like...
0
by: John Bradley | last post by:
I've read and understood the w3 specs on css1 and css2. I've done some positioned layouts on my own system that worked as expected. But - I'm concerned about letting anything on to the live system...
5
by: Alex Bell | last post by:
I have a fluid header/two column layout at http://www.members.iinet.net.au/~abell1/test/demo10.htm which works with windows MSIE 5.5 and 6, Mozilla, Netscape, and Opera; and Safari but which...
7
by: Alan J. Flavell | last post by:
A colleague recently breezed in with a new web page design. He didn't tell me where he got the ideas from, but ... Looking at his stylesheets, I noticed they identified themselves as...
2
by: Mario T. Lanza | last post by:
Greetings, I have been developing websites in CSS for a couple years; I claim to be no expert, but certain things could definitely be easier. Consider the box model and it's different...
16
by: Michael Rozdoba | last post by:
I'm far from a CSS expert, but what I see of it I really like & I love keeping content & style separate. I also hate the way table layout produces convoluted bulky code. However when asked why...
6
by: glakk | last post by:
I got on the tableless layout bandwagon early on, and thought it was a really cool way to lay out a page. I don't know why I thought it was so cool, except I guess I fell for the "oh, cool" talk. ...
5
by: Stan R. | last post by:
Greetings. I have a couple of questions concerning CSS layouts, as apposed to the old <tablemethod for creating layouts . Even after spending the last few days searching all over Google Groups, I...
4
by: james00 | last post by:
Switching Page Layouts!!! Does anyone have any idea how to create a script for Switching Page Layouts. I know how to create one for Style Sheet Switcher ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.