resizing JPanel not working
I've got a JScrollPane with a JPanel set as its view. In this JPanel, I have a set of smaller panels layed out in rows. My program allows for the user to remove existing rows or add new rows to the parent JPanel. The problem I'm encountering is that when the user adds a new row, I need to resize the parent JPanel such that all rows are visible, but calling JPanel.setSize(int,int) or JPanel.setSize(new Dimension(int,int)) doesn't seem to do anything to the size of the parent JPanel. Is there anything special that must be done to JPanels that are views for a JScrollPane in order to see changes that are made to it? For example, do I need to call repaint(), do I need to set the view again (i.e. ScrollPane.getViewport().setView(MyParentPanel). I've tried these already, and I'm wondering if anyone has any other suggestions.
yeah i would have said repaint() but you have tried it eh? nothing happens? are you sure that your methods for adding another item are working?
A kram a day keeps the doctor......guessing
yes, because I shows the results of removing and item since that doesn't require resizing in order to make it visible. And when adding I have some System.out.println statements to track what's being added, and those seem to indicate it's working fine.
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center