J
Jeff Sandler
Do components work differently (or not at all) just because they're in
an applet vs. an application? My applet has a JTextArea inside a
JScrollPane and it doesn't seem to show the scroll bar no matter what.
I've tried setting the scroll bar policy, resizing the applet within the
HTML, resizing the JScrollPane, resizing the JTextArea, resizing browser
window while it's showing the applet, etc. The scroll bar still didn't
show. I even tried making it an application instead of an applet, and
the scroll bar was there just like I expected. Here's a portion of the
init() method in question....
outputArea = new JTextArea();
StringBuffer deleteMe = new StringBuffer();
for(int i=1;i<=100;i++)
{
deleteMe.append(i);
deleteMe.append("\n");
}
outputArea.setText(deleteMe.toString());
scroller = new JScrollPane(outputArea);
Container myContainer = getContentPane();
myContainer.setLayout(new FlowLayout());
myContainer.add(scroller);
scroller.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
Also, I don't know if this is significant or not. When I highlight the
text in the JTextArea, it acts like the text ends where the bottom of
the JTextArea ends. In other words, the rest of the text just
disappears. Thank you in advance for your help.
an applet vs. an application? My applet has a JTextArea inside a
JScrollPane and it doesn't seem to show the scroll bar no matter what.
I've tried setting the scroll bar policy, resizing the applet within the
HTML, resizing the JScrollPane, resizing the JTextArea, resizing browser
window while it's showing the applet, etc. The scroll bar still didn't
show. I even tried making it an application instead of an applet, and
the scroll bar was there just like I expected. Here's a portion of the
init() method in question....
outputArea = new JTextArea();
StringBuffer deleteMe = new StringBuffer();
for(int i=1;i<=100;i++)
{
deleteMe.append(i);
deleteMe.append("\n");
}
outputArea.setText(deleteMe.toString());
scroller = new JScrollPane(outputArea);
Container myContainer = getContentPane();
myContainer.setLayout(new FlowLayout());
myContainer.add(scroller);
scroller.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
Also, I don't know if this is significant or not. When I highlight the
text in the JTextArea, it acts like the text ends where the bottom of
the JTextArea ends. In other words, the rest of the text just
disappears. Thank you in advance for your help.