GeeCON Prague 2014*
The moose likes Swing / AWT / SWT and the fly likes JList in NetBeans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JList in NetBeans" Watch "JList in NetBeans" New topic
Author

JList in NetBeans

vinderela mistery
Greenhorn

Joined: Jan 02, 2013
Posts: 7
Hello,

I need to use JList in NetBeans. I added a JList in interface. I try to populate the JList and I used some code from docs.oracle.com, but in JList I receive the value from definite model in interface. How I can change the value to the list? Please help me to solve this problem.

Regards,
Vinderela
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1084
    
  10

Hi vinderela,
Your post is not clear enough for us to offer solutions. Can you post your code which would show how you setup the model?


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
vinderela mistery
Greenhorn

Joined: Jan 02, 2013
Posts: 7
I have a JList in interface, and I want to populate in program:

Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> How I can change the value to the list

create a new listModel, same way as initial code.
then:
list.setModel(newListModel);
vinderela mistery
Greenhorn

Joined: Jan 02, 2013
Posts: 7

Thanks.
 
GeeCON Prague 2014
 
subject: JList in NetBeans