Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2020071 | 1.3.0 | J. Duke | P4 | Resolved | Fixed | kestrel |
JDK-2020070 | 1.2.2_002 | J. Duke | P4 | Resolved | Fixed | b02 |
JDK-2020069 | 1.2.1_002 | J. Duke | P4 | Resolved | Fixed | b02 |
JDK-2020068 | 1.1.8_001 | J. Duke | P4 | Resolved | Fixed | b01 |
The starting point of the first character of the text inside a TextField is after 5 pixel (more or less) if using Windows95 and 1 pixel if using NT 4.0 or Solaris 2.x.
The same number of pixels is added at the end of the TextField, so the field is larger on Windows95 and you cannot create a useful and portable stack of numeric textfields (TextFields and Label and so on) to be used in an application with SubTotals and Totals. It is not possible to solve the problem using any Layout Manager nor changing fonts. You can see the same behavior using jdk 1.1.5 or 1.2beta3. See the following example:
import java.awt.*;
public class TestField {
public static void main(String[] args) {
Frame frame = new Frame("Frame with a text field & a label");
frame.setBackground(Color.black);
frame.setLayout(new GridLayout(2,1));
// different position of text on Windows95
TextField text_field = new TextField("Left Textfield");
text_field.setBackground(Color.yellow);
frame.add(text_field);
System.out.println("Caret position: " +
text_field.getCaretPosition());
Label label = new Label("Left Label");
label.setBackground(Color.blue);
frame.add(label);
frame.setBounds(50,50,300,300);
frame.setVisible(true);
}
}
The same number of pixels is added at the end of the TextField, so the field is larger on Windows95 and you cannot create a useful and portable stack of numeric textfields (TextFields and Label and so on) to be used in an application with SubTotals and Totals. It is not possible to solve the problem using any Layout Manager nor changing fonts. You can see the same behavior using jdk 1.1.5 or 1.2beta3. See the following example:
import java.awt.*;
public class TestField {
public static void main(String[] args) {
Frame frame = new Frame("Frame with a text field & a label");
frame.setBackground(Color.black);
frame.setLayout(new GridLayout(2,1));
// different position of text on Windows95
TextField text_field = new TextField("Left Textfield");
text_field.setBackground(Color.yellow);
frame.add(text_field);
System.out.println("Caret position: " +
text_field.getCaretPosition());
Label label = new Label("Left Label");
label.setBackground(Color.blue);
frame.add(label);
frame.setBounds(50,50,300,300);
frame.setVisible(true);
}
}
- backported by
-
JDK-2020068 win32: There are 5 pixels before and after the text displayed in a TextField
-
- Resolved
-
-
JDK-2020069 win32: There are 5 pixels before and after the text displayed in a TextField
-
- Resolved
-
-
JDK-2020070 win32: There are 5 pixels before and after the text displayed in a TextField
-
- Resolved
-
-
JDK-2020071 win32: There are 5 pixels before and after the text displayed in a TextField
-
- Resolved
-
- duplicates
-
JDK-4332990 win32: There are 5 pixels before and after the text displayed in a TextField
-
- Closed
-