How to create control array in swings...............

Recommended Answers

All 4 Replies

what is/are control Array in/for Swing

what is/are control Array in/for Swing

I want to create a control with the same name but the index is different .........
In vb.net or vb i did. but in java i dnt know sir....

huuuh this one was good, then I don't know anything about VB/VBA, that little bit OffTopic but .....

Java (thank you God for that) is Strict for create Components and Object just once and case sensitive,

sure I don't find relationship between VB and Java as you decsribed, be ensure that you call thinks with correct technocrati names

You can create an array of swing components exactly like an array of any other class, eg

JButton[] myArrayOfJButtons = new JButton[6]; // creates empty array for 6 JBUttons
for (int i = 0; i < myArrayOfJButtons ; i++) {
  myArrayOfJButtons[i]= new JButton... // put a button into the array
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.