For Programmers: Free Programming Magazines  


Home > Archive > Java Beans > March 2004 > How to set size of Jlabel?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to set size of Jlabel?
Brett Trost

2004-03-19, 8:45 pm

This may sound like a dumb question, but how do you set the size of a
Jlabel? I am using NetBeans, and I have tried setting the maxsize,
minsize and preferredsize properties, but changing them doesn't seem
to do anything at all! Right now, my labels are way too big.

Also, how to I make it so that a Jlist box will have scroll bars if
there are too many items to be visible?

Thanks for any help!
Christophe Vanfleteren

2004-03-19, 8:45 pm

Brett Trost wrote:

> This may sound like a dumb question, but how do you set the size of a
> Jlabel? I am using NetBeans, and I have tried setting the maxsize,
> minsize and preferredsize properties, but changing them doesn't seem
> to do anything at all! Right now, my labels are way too big.


You'll need to learn the basic of layoutmanagers.

> Also, how to I make it so that a Jlist box will have scroll bars if
> there are too many items to be visible?


Put it in a JScrollpane.

> Thanks for any help!


You should also read http://java.sun.com/docs/books/tutorial/uiswing/
sometime, so you can answer these very basic questions yourself.

--
Kind regards,
Christophe Vanfleteren
Brett Trost

2004-03-19, 8:45 pm

Christophe Vanfleteren <c.v4nfl3t3r3n@pandora.be> wrote in message news:<VLQ%b.15683$ka7.832675@phobos.telenet-ops.be>...
> Brett Trost wrote:
>
>
> You'll need to learn the basic of layoutmanagers.


Well in my Gridlayout thing, there are only 4 properties, none of
which appear to change the size of the objects within. I really would
like an answer to this.

>
> Put it in a JScrollpane.


Thanks!
>
> You should also read http://java.sun.com/docs/books/tutorial/uiswing/
> sometime, so you can answer these very basic questions yourself.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com