Click here to Skip to main content
11,647,810 members (55,454 online)
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 19:30pm
Edited 20-Dec-12 20: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 jyo.net 500
1 F-ES Sitecore 370
2 DamithSL 290
3 CPallini 290
4 OriginalGriff 277
0 OriginalGriff 1,342
1 jyo.net 994
2 DamithSL 971
3 Sergey Alexandrovich Kryukov 873
4 CPallini 845


Advertise | Privacy | Mobile
Web01 | 2.8.150804.4 | Last Updated 21 Dec 2012
Copyright © CodeProject, 1999-2015
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