Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4167057
Votes 0
Synopsis JTextField has cursor and focus problem in JWindow.
Category java:classes_swing
Reported Against 1.2fcs
Release Fixed
State 11-Closed, duplicate of 4186928, bug
Priority: 4-Low
Related Bugs 4186928
Submit Date 18-AUG-1998
Description
JDK Version: 1.2fcs-F
OS: Solaris 2.6
Locale: C, zh

If we add JTextField in JWindow, we find that, we could not see the cursor in
the JTextField, and the JTextField will easily have a Focus problem, that 
is if we type chars and hilight in it, and after several times, we will find
that the JTextField will not gain focus any more. Following is a program to 
reproduce it.
======================JTextFocus.java=================================
import java.awt.*;
import java.awt.event.*;
import com.sun.java.swing.*;

public class JTextFocus {
    JWindow win;
    JTextField tf1;
    JTextField tf2;

    public JTextFocus() {
	win = new JWindow();
	tf1 = new JTextField("ABCDEFGH", 10);
	tf2 = new JTextField("12345678", 10);
	win.getContentPane().setLayout(new FlowLayout());
	win.getContentPane().add(tf1);
	win.getContentPane().add(tf2);
	win.pack();
	win.show();
    }

    public static void main(String args[]) {
	new JTextFocus();
    }
}
=========================================================================

[  xxxxx@xxxxx   1998-08-18]
Work Around
N/A
Evaluation
This is not swing specifc, focus in awt Windows is problematic. If the appropriate events are not generated swing will not work correctly, which is what is happening. Refer to bug 4186928 for more information on this.
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang