Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / July 2008

Tip: Looking for answers? Try searching our database.

different sized buttons

Thread view: 
K Gaur - 30 Jun 2008 07:35 GMT
hello friends

i have created a 10 * 10 grid of buttons using grid layout
2 rows of buttons need to be of greater height, the width being the
same

i think a different layout manager is needed but cant conclude which
one will suite the purpose

please help

thanks
Roedy Green - 30 Jun 2008 09:01 GMT
>i have created a 10 * 10 grid of buttons using grid layout
>2 rows of buttons need to be of greater height, the width being the
>same

Gridbag lets you pad the height with ipady
see http://mindprod.com/jgloss/gridbaglayout.html
Signature


Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

K Gaur - 01 Jul 2008 04:14 GMT
i should have wrote this before but
i also need to put images on those buttons
and it is because 2 rows of images are of larger height that i need
taller buttons

so isn't there a way by which the buttons adjust automatically to the
size of the imageicon
this way the design would become simpler
Daniele Futtorovic - 01 Jul 2008 06:44 GMT
> i should have wrote this before but
> i also need to put images on those buttons
[quoted text clipped - 3 lines]
> so isn't there a way by which the buttons adjust automatically to the
> size of the imageicon

Yes, but not with a GridLayout -- the very purpose of which it is to
have uniformed grid cells.

> this way the design would become simpler

<http://java.sun.com/docs/books/tutorial/uiswing/index.html>

and more especially:

<http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html>

Signature

DF.
to reply privately, change the top-level domain
in the FROM address from "invalid" to "net"

K Gaur - 04 Jul 2008 10:12 GMT
> Yes, but not with a GridLayout
thanks but i really would like to know that way

please help
RedGrittyBrick - 04 Jul 2008 10:27 GMT
>> Yes, but not with a GridLayout
> thanks but i really would like to know that way

Did you read the tutorials Daniele pointed out to you?
Which bit of those tutorials are you having problems with?

> please help

Post an SSCCE (http://sscce.org/) using one of the other layouts.
e.g. One of GridBagLayout, nested BoxLayouts, ...

If you do that, I'll certainly spend some time looking into whatever
problem you have.

Signature

RGB

K Gaur - 08 Jul 2008 08:21 GMT
well thanks
but i got the prob solved
just that i had to make a custom layout manager


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.