Hi all,
as the subject line appears, the JScrollPane doesn't appear when the
JPanel in its veiw port becomes bigger than the scroll pane. Does
anyone see anything obviously wrong with this code?
JFrame myFrame1 = new JFrame();
Container contentPane1 = myFrame1.getContentPane();
myFrame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
String [] labels = {"Sas","asd", "asdf", "aew"};
Grapher myGrapher = new Grapher(labels);
JScrollPane pane1 = new JScrollPane();
pane1.setViewportView(myGrapher);
contentPane1.add(pane1);
myFrame1.show();
Grapher is a class that extends JPanel and overrides the
paintComponent (Graphics g) method..
Cheers
Taras
Christian Kaufhold - 26 Nov 2003 12:01 GMT
> as the subject line appears, the JScrollPane doesn't appear when the
> JPanel in its veiw port becomes bigger than the scroll pane. Does
> anyone see anything obviously wrong with this code?
Putting JScrollPane into a FlowLayout.
Christian

Signature
And in short, I was afraid.