473,856 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

1 New Member
please help me where to put this particular code
[DefaultListMode l number = new DefaultListMode l();
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 64216
dev7060
645 Recognized Expert Contributor
please help me where to put this particular code
[DefaultListMode l number = new DefaultListMode l();
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
4858
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 I'd like it to display ALL items. For example, not just the ids of buttons, inputs, etc, but any <span> elements as well. Is there something I could replace with the "elements"? I tried tags but that doesn't work either. Thanks!
60
4759
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 "\t" 99.99 and i need to access the individual floating point numbers from it! say for ex. the first no is 10.19.. i want to access this and add one to it. filename=open("half.transfac","r")
1
1242
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 will click means that time i don't want privious date, i want current and after date .
8
1473
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 increment to 2 like this can any one help me in this Please.., its urgent thanks a lot
4
5765
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 this:- System.Windows.Forms.TextBox, Text: Bob How can I get rid of this your help is greatly appreciated
0
9908
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9760
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11052
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10695
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9530
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7090
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4573
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4172
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.