Can I Index a button in Java ? button(i)
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Alex_Gomes
Posted On:   Friday, June 21, 2002 06:21 AM

			
I want to create lot of buttons and i want to do this with a loop "for" to create all the buttons

Re: Can I Index a button in Java ? button(i)

Posted By:   Anonymous  
Posted On:   Friday, June 21, 2002 06:44 AM


This should do it for you.



Button [] buttons;//initialize the button array
...
buttons = new Button [19]//instantiate the array with room
//for 20 buttons
for (int i = 0; i{
buttons [i] = new Button ("button " + i);
}


- Peter

About | Sitemap | Contact