-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.2.0
-
x86, sparc
-
solaris_2.6, windows_95
Name: diC59631 Date: 01/15/98
Take the following demo source and do a
javac Font1.java
java Font1
Type into the visible JTextfield some Text, e.g.
10 times the character 'm'. Textcursor is fine.
Type into the invisible JPasswordField the same
text. You can see a '*' for every character typed
in, which is correct. But a 'm' is wider than a '*'
and the cursor is exactely positioned
like in the visible JTextfield above.
Demonstration Java Source Code:
import java.awt.*;
import java.awt.event.*;
import java.awt.swing.*;
public class Font1 extends JPanel
{
Font1()
{
super();
setLayout(new GridLayout(0,1));
add(new JLabel("Enter some visible text"));
add(new JTextField(30));
add(new JLabel("Enter some invisible text"));
add(new JPasswordField(30));
}
public static void main(String [] args)
{
JFrame mainFrame = new JFrame("Test Font");
mainFrame.addWindowListener
(
new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
}
);
mainFrame.getContentPane().add(new Font1());
mainFrame.pack();
mainFrame.setVisible(true);
}
}
(Review ID: 23117)
======================================================================
daniel.indrigo@Canada 1998-01-1998
Another user report the same problem with the JTextArea in the NotePad
example provide with Swing.
- duplicates
-
JDK-4086564 In jdk1.2Beta1, the I-bean caret , in JTextField, is located at wrong position.
-
- Closed
-