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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ReQuistor
    New Member
    • Apr 2022
    • 1

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

    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

    Code:
    [DefaultListModel number = new DefaultListModel();
        private void button1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
        int nCounter;
        for (nCounter =1;nCounter<=5;nCounter++){
        number.addElement(""+nCounter);
        this.list1.setMode(number);
        }
        // TODO add your handling code here:
        }]
    Last edited by zmbd; Apr 28 '22, 04:41 AM. Reason: Z{Merging duplicate threads - and fixing proper [CODE][/CODE] tag placement}]
  • dev7060
    Recognized Expert Contributor
    • Mar 2017
    • 656

    #2
    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?

    Comment

    Working...