Audra
Posts: 1
Nickname: domino
Registered: Jan, 2004
|
|
Re: How to make JPanel scrollable?
|
Posted: Jan 29, 2004 2:48 PM
|
|
Hrm, seems pretty convoluted. My uneducated first guess would be that adding the JScrollPane to a JPanel and then adding the JPanel could interfere with JScrollPane's ability to scroll, but that could be entirely false. In any case, draw is already extended from JPanel and then added to scroller. jp seems like one extra component too many. Adding scroller directly to the content pane should do this here; the content pane shouldn't be limited to taking only JPanels, it can take JScrollPanes directly, unless there's a specific reason you're adding the extra JPanel.
Drawing draw= new Drawing(); JScrollPane scroller = new JScrollPane(draw); getContentPane.add(scroller); show();
|
|