473,461 Members | 1,515 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Why are my swing components so big?

153 100+
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
Jun 18 '09 #1
1 1822
JosAH
11,448 Expert 8TB
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
Jun 18 '09 #2

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

Similar topics

0
by: Rick | last post by:
Hi, I'm trying to make applets as small as possible. Most applets only needs some textfields, a list and some buttons. Here I can choose between AWT and Swing components. Swing looks nicer but...
5
by: Chris | last post by:
Having been traumatised many years ago when using MFC/C++ to develop front-end code, I've religiously avoided GUI work since and stuck to back-end / server-side projects. So I'm a bit of a novice...
0
by: Hal Vaughan | last post by:
I'm testing a GUI app on a couple Linux boxen and one Win2k box. I'm using Java 1.4.2 on each (or the closest on Win2k -- whatever version comes close). On one Linux box and the Win2k box the...
6
by: Joseph | last post by:
hi 1) i plan on having an awt canvas component (to draw graphs) on a JFrame with other swing components..will this be okay? i've read that swing and awt aren't compatible.. 2)Also, if i...
2
by: Joseph | last post by:
Can anyone explain to me the benefit of using a JPanel and adding it to a JFrame ; where all the components(buttons,etc.) are added to JPanel. Compared to skipping the JPanel and just adding the...
2
by: Leo P. | last post by:
I haven't used Swing too much, but I've recently run into a problem that I'm not sure how to fix. When I remove all components from a JPanel and then add new components to it, the panel displays...
3
by: bergel | last post by:
Hello, Does anyone already have some experience in mixing AWT and Swing? Is it conceptually doable? Does the design of Swing prevent interaction between an AWT and a Swing widget? Regards,...
0
by: Ney André de Mello Zunino | last post by:
Hello. I have decided to look again at Java after a *really* long break. While browsing through the Swing tutorials , I noticed that the basic skeleton of the demo applications had something...
4
by: Gautam Parai | last post by:
Hi!!!!! Can anyone please tell me how can we embed Swing Components in a Web Browser ..... e.g. can i embed a JTextBox in a webbrowser in which a user can write something.... a general guideline...
6
by: r035198x | last post by:
I have put together this article to give people starting Swing an awareness of issues that need to be considered when creating a Swing application. Most of the Swing tutorials that I have seen just...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.