I have a problem regarding loops. I need to access 10 labels which have names like label1, label2, label3 .... etc. I need to know whether I can access those labels by going through a loop in java?
- 1this sounds horrible. You should restructure that codeBozho– Bozho2011-08-23 10:02:09 +00:00Commented Aug 23, 2011 at 10:02
- 1More detail? What are labels? Why not put them into an array?Brett Walker– Brett Walker2011-08-23 10:02:56 +00:00Commented Aug 23, 2011 at 10:02
- Do you mean these? download.oracle.com/javase/6/docs/api/java/awt/Label.htmlRichard H– Richard H2011-08-23 10:03:48 +00:00Commented Aug 23, 2011 at 10:03
- Please clarify your question, the answers are using JLabel objects, but your question sounds like if you where asking about "goto labels" inside a for loop!Angel O'Sphere– Angel O'Sphere2011-08-23 13:27:18 +00:00Commented Aug 23, 2011 at 13:27
Add a comment |