Scroll Pane ?

I am using a Border Layout for the main GUI, and within the Center of the main GUI i have another GUI also using a border layout. I am trying to make the center of the center GUI a scrollpane, but can't seem to do it. Is it possible, and if so how is it done ?Thanks
[288 byte] By [at1213] at [2007-9-26 1:52:54]
# 1

I will try this

When you are defining the central GUI of the central area of the main GUI, you would have to define it in a JPanel. After that then you would add the JScrollPane to that JPanel.

Example

cp= getContentPane();

cp.setLayoutManager(new BorderLayout());

...

JPanel centerPane= getCenterPane();

...

cp.add(centerPane, BorderLayout.CENTER);

...

JPanel getCenterPane()

{

JPanel jp= new JPanel();

jp.setLayoutManager(new BorderLayout());

...

JScrollPane scrollingCenterPane= getScrollingCenterPane();

jp.add(scrollingCentralPane, BorderLayout.CENTER);

...

return jp;

}

JScrollPanel getScrollingCenterPane()

{

JPanel jp= new JPanel();

// define the JPanel here

JScrollPane jsp= new JScrollPane(jp);

return jsp;

}

I didn't test it but I think it should work

juani1 at 2007-6-29 3:03:17 > top of Java-index,Archived Forums,Swing...
# 2
This might be my problem, but what is the difference between JScrollPane and JScrollPanel ?
at1213 at 2007-6-29 3:03:17 > top of Java-index,Archived Forums,Swing...
# 3
they are the same.it was only a typed error
R2D2 at 2007-6-29 3:03:17 > top of Java-index,Archived Forums,Swing...