ScrollPane
Bor <[email protected]> Thu, 26 Jun 2008 04:26:11 -0700 (PDT)
| Newsgroups | gmane.comp.java.netbeans.user-interface |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I have a question about jScrollPane. I would like to have multiple JPanel
forms that I would dynamically include into a panel (or scrollPane) on the
main frame (like a menu on the left and changing main area that depends on
which menu you clicked). I would like to show the whole panels within
scrollpanes on smaller resolutions or if user changes the window size.
Panels would probably have predefined size. What I'm asking is, what do I
have to do to get scrollbars when window gets resized (if needed, that means
if the container panel gets too small for the dynamically inserted panel to
show). Currently, on Linux, the contents of the main panel disappear when I
resize, so there must be a repaint problem or so. I have not managed to get
the scrollbars yet.
My code for adding panels dynamically is something like this:
@Action
public void bClicked() { // menu click action
p = new Panel(); // create an instance of a Panel
p.setSize(400, 300); // if I don't set size the panel doesn't show
p.setLocation(10, 10);
jScrollPane1.add(p); // adding the panel to the ScrollPane
p.validate(); // found somewhere; repaint doesn't work here, not on p,
neither on jScrollPane...
}
The project is in very beginning phase now but i'm going to start developing
it more seriously in a few days. Any help would be appreciated.
--
View this message in context: http://www.nabble.com/ScrollPane-tp18131587p18131587.html
Sent from the Netbeans - UI mailing list archive at Nabble.com.