• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to set the size of aJList?  RSS feed

 
netharam ram
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I have a JFrame that contains a JList & a JLabel.When the JFrame is created the JList will be empty,the size of it is larger than that of the JLabel which is empty too.The JList is added with values one by one by the user.When a value is added to the list it is resized to fit to the length of the added value.Can't this be set to a specific value at the beginning itself.I'm using BorderLayout().Please help me out.
Happy middling with java.
Netharam.
 
Raja Kannappan
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The method setFixedCellWidth() in JList might help.
- Raja.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!