473,395 Members | 1,689 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,395 software developers and data experts.

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 1821
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.