• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JList Problem in swings

 
siva chaitanya
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can't able to add elements in JList. I have taken DefaultListModel and JList to add elements but i can't able to make it. This is the code.

 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You added the JList to the JScrollPane. What is the parent container for JScrollPane? Did you add it to anything?
When you run this code, do you even see the JFrame? I do not see any code which will set it's dimensions nor any pack call. Is this your real code?
 
siva chaitanya
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya i have seen the frame and also the JList but i can't see the elements in the jlist
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please share your full and real code so we can try and figure out what's going wrong
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic