United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6472901 GTK Theme change and JTextField can/will crash Java
JDK-6472901 : GTK Theme change and JTextField can/will crash Java

Details
Type:
Bug
Submit Date:
2006-09-20
Status:
Closed
Updated Date:
2011-03-07
Project Name:
JDK
Resolved Date:
2011-03-07
Component:
client-libs
OS:
solaris_10
Sub-Component:
javax.swing
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports
Backport:

Sub Tasks

Description
FULL PRODUCT VERSION :
java version "1.6.0-rc"
Java(TM) SE Runtime Environment (build 1.6.0-rc-b95)
Java HotSpot(TM) Client VM (build 1.6.0-rc-b95, mixed mode, sharing)


ADDITIONAL OS VERSION INFORMATION :
Solaris

A DESCRIPTION OF THE PROBLEM :
When switching themes in GTK and a JTextField is being used, Java can/will crash.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the testcase.
Begin switching the themes.  At some point, maybe early on maybe after a couple of switches  java will crash.  My most recent attempt at switching themes took only 2 switches to cause the crash.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
no crash
ACTUAL -
a crash

ERROR MESSAGES/STACK TRACES THAT OCCUR :
(<unknown>:10076): Gtk-WARNING **: GtkEntry - did not receive focus-out-event. If you
connect a handler to this signal, it must return
FALSE so the entry gets the event as well

Gtk-ERROR **: file gtkentry.c: line 4671: assertion failed: (GTK_WIDGET_HAS_FOCUS (entry))
aborting...
zsh: IOT instruction (core dumped)  java GTK_JTextField


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javax.swing.*;
import javax.swing.text.*;
import java.awt.*;
import java.awt.event.*;

public class GTK_JTextField implements Runnable{

    public void run(){
        JFrame jf = new JFrame();
        JTextComponent jtf1 = new JTextField(20);
        jf.add(jtf1);
        jf.pack();
        jf.setVisible(true);
    }

    public static void main(String ... args){
        try{
	    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch(Exception x){}
        SwingUtilities.invokeLater(new GTK_JTextField());
    }

}
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
don't change themes.

                                    

Comments
EVALUATION

GtkEntry selection should be handled in native code correctly.
                                     
2006-09-20
SUGGESTED FIX

When there are many other widgets try to switch the focus to another widget that text area.
                                     
2006-09-20
EVALUATION

gtk-cursor-blink setting for gtk_entry should be switched off to avoid generation cursor_blink timer actions.
                                     
2006-09-26
EVALUATION

Contribution forum : https://jdk-collaboration.dev.java.net/servlets/ProjectForumMessageView?forumID=1463&messageID=15676
                                     
2006-09-26



Hardware and Software, Engineered to Work Together