472,344 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,344 software developers and data experts.

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.     }]
Apr 28 '22 #1
1 63088
dev7060
625 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?
May 16 '22 #2

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

Similar topics

3
by: Mike Hnatt | last post by:
for(var i=0;i<document.all.elements.length;i++){ alert(document.forms.elements.id); } This code displays the ids of only controls in a form, but...
60
by: aboxylica | last post by:
my file is of the form 01 "\t" 10.19 "\t" 0.00 "\t" 10.65 02 "\t" 11.19 "\t" 10.12 ...
1
by: reshmapk | last post by:
hello...i want a php code for my calander control.actually i want ...in my form having 'from' calander control and 'to' in 'from' calander.sapose i...
8
chandru8
by: chandru8 | last post by:
hi every body i need a logic , that for a particular code i need to genrate a serial number for a day should be one for the next day it should be...
4
by: msdhh | last post by:
Hi there, Im having a problem in my sql database, when i enter data in the textbox called "Name" and then i save it. it shows in the database like...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.