-
Bug
-
Resolution: Not an Issue
-
P1
-
None
-
1.1
-
generic
-
generic
+-------------------------- + ---(1)
| +-------------- + |
| | | |
| | TextArea | |
| | | |
| | | |
| +-------------- + |
+-------------------------- +
| small | <== push
+-------------------------- +
+-------------------------- +---(2)
| +------ + |
| | Text | |
| | Area | | : Text area becomes small.
| +------ + |
| |
| |
+-------------------------- +
| small |
+-------------------------- +
(3) Resizing Appletviewer Window:
+-------------------------- +
| +-------------- + |
| | | |
| | TextArea | | : Size of TextArea becomes
| | | | same as original.
| | | |
| +-------------- + |
+-------------------------- +
| small |
+-------------------------- +
sample program:
import java.awt.*;
import java.applet.*;
public class area extends java.applet.Applet{
TextArea tv;
Panel cpal;
Checkbox cm;
public void init() {
resize(900, 500);
tv = new TextArea("123456", 10, 20);
setLayout(new BorderLayout(0,0));
Panel tpal = new Panel();
tpal.add(tv);
cpal = new Panel();
cpal.setLayout(new GridLayout(1,1));
cm = new Checkbox("Small",null,true);
cpal.add(cm);
add("South",cpal);
add("Center",tpal);
}
public boolean action(Event e, Object obj) {
if(e.target instanceof Checkbox){
Checkbox cb = (Checkbox)e.target;
if(cb.getLabel().equals("Small")){
tv.setBounds(20,20,100,100);
return false;
}
}
return false;
}
}
| +-------------- + |
| | | |
| | TextArea | |
| | | |
| | | |
| +-------------- + |
+-------------------------- +
| small | <== push
+-------------------------- +
+-------------------------- +---(2)
| +------ + |
| | Text | |
| | Area | | : Text area becomes small.
| +------ + |
| |
| |
+-------------------------- +
| small |
+-------------------------- +
(3) Resizing Appletviewer Window:
+-------------------------- +
| +-------------- + |
| | | |
| | TextArea | | : Size of TextArea becomes
| | | | same as original.
| | | |
| +-------------- + |
+-------------------------- +
| small |
+-------------------------- +
sample program:
import java.awt.*;
import java.applet.*;
public class area extends java.applet.Applet{
TextArea tv;
Panel cpal;
Checkbox cm;
public void init() {
resize(900, 500);
tv = new TextArea("123456", 10, 20);
setLayout(new BorderLayout(0,0));
Panel tpal = new Panel();
tpal.add(tv);
cpal = new Panel();
cpal.setLayout(new GridLayout(1,1));
cm = new Checkbox("Small",null,true);
cpal.add(cm);
add("South",cpal);
add("Center",tpal);
}
public boolean action(Event e, Object obj) {
if(e.target instanceof Checkbox){
Checkbox cb = (Checkbox)e.target;
if(cb.getLabel().equals("Small")){
tv.setBounds(20,20,100,100);
return false;
}
}
return false;
}
}