Why is it that whenever I use this method on a component (JPanel, JScrollPane, JList etc.), it makes not one iota of a difference to its actual size? Paul
Try setPreferredSize. When doing layout, prefer methods defined in swing components (e.g. javax.swing.JComponent) over those in awt components (e.g. java.awt.Component). Now, don't expect all layout managers to respect the preferred size of a component. You may want to use setMinimumSize and/or setMaximumSize, if that is really what you want to do. Don't use those just to set the initial size. Bill
Thanks Bill. I'm kinda going back to my original question about JList. I want to display a box that contains nothing but could contain a rapidly increasing list of strings. I want the box to look something like the thing I'm typing into now but I have no idea how to get the thing to display unless I add a vector containing information - and I still have no control over the size of it. How do I display a box, which never changes its size whether there's data in it or not? Paul
How are you adding data to the JList? I think the problem may be more with your layout manager than your component or data. What layout manager are you using? For example, if you used BorderLayout and added the JList, in a JScrollPane, to your panel at BorderLayout.CENTER, it should stretch in both directions. Bill
Post by:autobot
yeah, but ... what would PIE do? Especially concerning this tiny ad:
a bit of art, as a gift, the permaculture playing cards