470,632 Members | 1,479 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,632 developers. It's quick & easy.

hello, a newbie here. Help resolve this particular code.

please help me where to put this particular code
[DefaultListModel number = new DefaultListModel();
it tried putting it down the private void button but still error. i dont know what to do anymore

Expand|Select|Wrap|Line Numbers
  1. [DefaultListModel number = new DefaultListModel();
  2.     private void button1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
  3.     int nCounter;
  4.     for (nCounter =1;nCounter<=5;nCounter++){
  5.     number.addElement(""+nCounter);
  6.     this.list1.setMode(number);
  7.     }
  8.     // TODO add your handling code here:
  9.     }]
4 Weeks Ago #1
1 55134
dev7060
569 Expert 512MB
please help me where to put this particular code
[DefaultListModel number = new DefaultListModel();
it tried putting it down the private void button but still error. i dont know what to do anymore
What error? How about declaring it as a class member and initializing it in the constructor?
1 Week Ago #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Mike Hnatt | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.