-
Bug
-
Resolution: Cannot Reproduce
-
P3
-
None
-
1.3.0
-
x86
-
generic
Name: jbT81659 Date: 08/30/2000
OS: RedHat Linux 6.2 KDE
JDK: jdk1.3.0rc1-b17
DELETE key functionality is broken in JPasswordField.
Instead of deleting characters,pressing "Delete" key prints
stars '*' into JPasswordField.
To reproduce bug:
1- Compile and run the following code
2- type some text into JPasswordField
3- Press the "Home" key to get to start of text
4- Press "DEL" key continuously
5- Note that none of the characters are deleted, and that more characters
are inserted.
----------Code---------------
/* Copyright (c) Sun Microsystems 1998
$Header: /home/sun/src/JDK1.2/jPasswordField.java,v 1.13 2000/03/30 08:13:08 isam Exp $
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class jPasswordField extends JApplet
{
public void init()
{
pass1 pass = new pass1();
getContentPane().add(pass);
}
public static void main(String[] argv)
{
JFrame frame = new JFrame("\u0645\u062b\u0627\u0644");
frame.setContentPane(new pass1());
frame.pack();
frame.setVisible(true);
frame.addWindowListener( new WindowAdapter()
{
public void windowClosing( WindowEvent e)
{
System.exit(0);
}
});
}
}
class pass1 extends JPanel
{
public pass1()
{
JPanel p = new JPanel();
p.setLayout(new GridLayout(2, 2, 2, 2));
JLabel label1 = new JLabel();
label1.setFont(new Font("Lucida Sans regular",Font.PLAIN,10));
label1.setText("\u0627\u0644\u0625\u0633\u0645\u0020\u05e9\u05dd");
p.add(label1);
p.add(new JTextField());
JLabel label2 = new JLabel();
label2.setFont(new Font("Lucida Sans regular",Font.PLAIN,10));
label2.setText("\u05e1\u05e1\u05de\u05d4\u0020\u0643\u0644\u0645\u0629\u0020\u0627\u0644\u0633\u0631");
p.add(label2);
JPasswordField pass = new JPasswordField();
pass.setEditable(true);
p.add(pass);
setLayout(new FlowLayout());
add(p);
validate();
}
}
-----------------------------
WorkAround:
======================================================================