Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Java Swing GUI
hi
I Need to design a front end for my java application. The front end looks somewhat like this:
In Panel 1:
Text
Text.....................................................Text
TextArea1...................Button1......................TextArea1
TextArea1...................Button2......................TextArea1
TextArea1...................Button3......................TextArea1
 
Text....TextBox1
Text....TextBox2............................Button1
Text....TextBox3............................Copyright Text
 
I ahve been able to get the boxes alright but arranging them properly is giving me lots of troubles.
If Possible please help me.
I am okay with backend but have no Idea of Swings.
The GUI i am getting is all hotch potch using Jpanel.
Arrangement in the designated format is necessary and binding.
 
[edit]SHOUTING removed, Code block added - OriginalGriff[/edit]
Posted 20-Dec-12 20:30pm
Edited 20-Dec-12 21:22pm
v2
Comments
OriginalGriff at 21-Dec-12 2:22am
   
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

A Visual Guide to Layout Managers[^]@ the Java Tutorials
 
Please be aware that you can combine the layouts. Each Area (probably JPanel) can have it's own layout:
 
Panel 1: Borderlayout
- North: GridbagLayout all "Text"
- West: "Textarea1"
- East: "Textarea1" (should probably be "Textarea2")
- center: Gridlayout or BoxLayout with Buttons

Panel 2: Gridlayout with specified column width
 

Some additional advice:
- build the layout step by step. use a "playground" project if you already have some code behind the GUI.
- Use background colors while creating the layout. You won't see the size of the panels otherwise.
- Not all Panels have to be in a single class. Especially static content is screaming for an own, fixed class.
  Permalink  
v4
Comments
TorstenH. at 21-Dec-12 4:04am
   
Edit: Sorry for the edits, I was fighting with the editor...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Marcin Kozub 310
1 OriginalGriff 248
2 Sergey Alexandrovich Kryukov 215
3 Richard MacCutchan 202
4 Praneet Nadkar 197
0 OriginalGriff 8,048
1 Sergey Alexandrovich Kryukov 7,287
2 DamithSL 5,614
3 Manas Bhardwaj 4,986
4 Maciej Los 4,910


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 21 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100