wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Change jLabel properties in loop Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Change jLabel properties in loop" Watch "Change jLabel properties in loop" New topic

Change jLabel properties in loop

Thomas Feld

Joined: Sep 08, 2009
Posts: 3
Hi, I'm new here, so I'm not sure where to post this...

Basically I have a bunch of jlabels, who's properties I want to change in a loop.
Is there a simple way to iterate through the jlabels and set properties in the loop?
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 38107
You would have to put them into an array or Collection to iterate them in a loop.

And welcome to JavaRanch
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10175

We have a forum dedicated for Swing. I will move this thread there for you.

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Thomas Feld

Joined: Sep 08, 2009
Posts: 3
Thanks, I know i have to put them in an array, though I'm not sure how to call them from there. What datatype would the array have to be?

I'm not sure that you could use a string:

I would like to do the following:
Rob Spoor

Joined: Oct 27, 2005
Posts: 19656

Then change the array type:

How To Ask Questions How To Answer Questions
Thomas Feld

Joined: Sep 08, 2009
Posts: 3
Thanks a lot!
Thats axactly what I needed
I agree. Here's the link: http://aspose.com/file-tools
subject: Change jLabel properties in loop
Similar Threads
Adding JLabels to a vector
Problems using JTabbedPane In a GUI application
how to print from 1 to 9 in a label ?
JList Item Not Getting Mouse Clicks