This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Change jLabel properties in loop" Watch "Change jLabel properties in loop" New topic
Author

Change jLabel properties in loop

Thomas Feld
Greenhorn

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
Sheriff

Joined: Oct 13, 2005
Posts: 37923
    
  22
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: 10167
    
    8

Thomas,
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
Greenhorn

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
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

Then change the array type:


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Thomas Feld
Greenhorn

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
JLabel