Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to add elements in JLIst in runtime (netBeans)

807569May 20 2006 — edited May 27 2006
hai

i have to add elements in the JList at the runtime.

What i have tried is that
DefaultListModel listmod=new DefaultListModel();


listmod.addElement("sorry");
After that in the

jList=new JList(listmod);

Here in this case the JList does not contains th element " sorry"
How this could be given in the netbeans... But the above coding works well in the Eclilpse but it does not works as well as i t does not give any error



Thanks
Shanthy
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 24 2006
Added on May 20 2006
4 comments
191 views