-
Bug
-
Resolution: Unresolved
-
P5
-
None
-
solaris_9, 1.1.1, 1.1.8_003, 1.3.0
-
Fix Understood
-
sparc
-
solaris_2.5.1, solaris_7, solaris_8
orig synopsis (clearly truncated):
"TextArea auto-scrolls to bottom only if no
appends are done before (what? peer i"
Name: mc57594 Date: 05/21/97
Run the application given below.
It creates two (almost) identical TextAreas, and then after
a button press, adds some lines to each. The only difference
in how they are created is that one is append()ed to just
after creation; one scrolls to the bottom to show new lines
as they are added, but the other does not.
// Java program follows ///////////////////////////////////////
import java.awt.*;
import java.awt.event.*;
public class Ta extends Panel {
Button countB;
TextArea t1, t2;
public Ta() {
add( t1 = new TextArea("",10,20) );
add( t2 = new TextArea("",10,20) );
t1.append("No scroll-to-bottom\n");
// t2.append("No scroll-to-bottom\n");
add( countB = new Button("Count") );
validate();
countB.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent
e) {
for (int i=1; i<=30; i++) {
t1.append("i = " + i +
"\n");
t2.append("i = " + i +
"\n");
}
}
}
);
}
public static void main(String[] args) throws Exception {
Frame f = new Frame();
f.add( new Ta() );
f.pack();
f.show();
}
}
company - IBM , email - ###@###.###
======================================================================
"TextArea auto-scrolls to bottom only if no
appends are done before (what? peer i"
Name: mc57594 Date: 05/21/97
Run the application given below.
It creates two (almost) identical TextAreas, and then after
a button press, adds some lines to each. The only difference
in how they are created is that one is append()ed to just
after creation; one scrolls to the bottom to show new lines
as they are added, but the other does not.
// Java program follows ///////////////////////////////////////
import java.awt.*;
import java.awt.event.*;
public class Ta extends Panel {
Button countB;
TextArea t1, t2;
public Ta() {
add( t1 = new TextArea("",10,20) );
add( t2 = new TextArea("",10,20) );
t1.append("No scroll-to-bottom\n");
// t2.append("No scroll-to-bottom\n");
add( countB = new Button("Count") );
validate();
countB.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent
e) {
for (int i=1; i<=30; i++) {
t1.append("i = " + i +
"\n");
t2.append("i = " + i +
"\n");
}
}
}
);
}
public static void main(String[] args) throws Exception {
Frame f = new Frame();
f.add( new Ta() );
f.pack();
f.show();
}
}
company - IBM , email - ###@###.###
======================================================================