Connecting Tech Pros Worldwide Help | Site Map

Why are my swing components so big?

  #1  
Old June 18th, 2009, 05:23 PM
Familiar Sight
 
Join Date: Nov 2007
Posts: 153
Hi all,

I might be being stupid here but for the life of me I can't understand/remember how to layouut my software so the buttons and textbox's don't go big, like filling the width and height of the jpanel the are contained in.

I have:

Jframe
it's content pane has a gridlayout(3,1)

I have added panel1(GridLayout(1,1)(contains a table ) to content pane
I have added panel2(GrisLayout(10, 2))(contains TextBoxes and Labels) to content pane
I have added panel3(GridLayout(1, 4)(contains 4 Huge Buttons) to content pane

My prolem is that my jbuttons are HUGE, filling whole of panel3 and so are my jtextboxes and jtextareas in panel2.

Is there something i'm missing - I just want nice small neatly spaced out buttons in panel3 and in panel2 I want the label and textbox to be on same row rather than different rows because the text box fills width of panel2.


Regards

brendan
  #2  
Old June 18th, 2009, 05:43 PM
JosAH's Avatar
Expert
 
Join Date: Mar 2007
Posts: 10,634
Provided Answers: 2

re: Why are my swing components so big?


Some of the layout managers link to the appropriate section of the Sun tutorials (e.g. see the API documentation for the BoxLayout class). Read those tutorials.

kind regards,

Jos
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
10 Reasons .NET developers should consider the switch to Mac OS RMZ answers 28 June 27th, 2008 09:19 PM
AJAX.NET and prototype.js Tony answers 31 August 8th, 2006 09:15 PM
Help me with threads. Jeff Louie answers 22 November 16th, 2005 07:07 PM
Is anything easier to do in java than in lisp? RobertMaas@YahooGroups.Com answers 73 July 18th, 2005 12:25 AM