-
Bug
-
Resolution: Fixed
-
P4
-
1.3.0
-
b45
-
x86
-
windows_nt
-
Verified
Name: bkC97677 Date: 01/05/2000
It is possible to process undo operation on the non-editable
java.awt.TextField object under Win32.
Here is the example demonstrating the bug:
------------- Test.java -------------------------
import java.awt.*;
import java.awt.event.*;
public class Test {
TextField tField = new TextField("before");
public Test() {
Frame f = new Frame();
f.setVisible(true);
f.setSize(100, 100);
Panel p2 = new Panel(new GridLayout(5, 1));
f.add(p2);
tField.setEditable(true);
p2.add(tField);
readOnlyProcessor listener = new readOnlyProcessor();
Button b = new Button("set read-only");
b.addActionListener(listener);
p2.add(b);
}
public static void main(String[] args) {
Test test = new Test();
}
class readOnlyProcessor implements ActionListener {
public void actionPerformed(ActionEvent e) {
String nameb = e.getActionCommand();
if (nameb.equals("set read-only")) {
tField.setEditable(false);
}
}
}
}
---------------------------------------------------
You should perform the actions:
1. Run Test under Win32
2. Change the text in TextField object
3. Press "set read-only" button
4. Click right mouse button on TextField.
5. Select "Undo" in Windows context menu.
-->
Text in non-editable TextField should change.
======================================================================
It is possible to process undo operation on the non-editable
java.awt.TextField object under Win32.
Here is the example demonstrating the bug:
------------- Test.java -------------------------
import java.awt.*;
import java.awt.event.*;
public class Test {
TextField tField = new TextField("before");
public Test() {
Frame f = new Frame();
f.setVisible(true);
f.setSize(100, 100);
Panel p2 = new Panel(new GridLayout(5, 1));
f.add(p2);
tField.setEditable(true);
p2.add(tField);
readOnlyProcessor listener = new readOnlyProcessor();
Button b = new Button("set read-only");
b.addActionListener(listener);
p2.add(b);
}
public static void main(String[] args) {
Test test = new Test();
}
class readOnlyProcessor implements ActionListener {
public void actionPerformed(ActionEvent e) {
String nameb = e.getActionCommand();
if (nameb.equals("set read-only")) {
tField.setEditable(false);
}
}
}
}
---------------------------------------------------
You should perform the actions:
1. Run Test under Win32
2. Change the text in TextField object
3. Press "set read-only" button
4. Click right mouse button on TextField.
5. Select "Undo" in Windows context menu.
-->
Text in non-editable TextField should change.
======================================================================