java - editing the default section and making an array of buttons -


as drag , drop button in netbeans,code generator generates code :

private javax.swing.jbutton jbutton1; private javax.swing.jbutton jbutton2; private javax.swing.jbutton jbutton3; 

what if want array of these buttons ? how edit in netbeans ?

like :

private javax.swing.jbutton buttonarray[] = new jbutton[3]; 

note: using netbeans 7.3

simply

jbutton[] buttonarray = {jbutton1, jbutton2, jbutton3};  

would work.

but having said that, far better off @ stage not use netbeans generated code @ , instead code swing applications hand. netbeans code generator can save time if understand swing well, if you're new swing , java, while can create easy gui's, can become impossible bear if want stretch envelope little bit.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -