-
Bug
-
Resolution: Won't Fix
-
P2
-
6u21-rev
-
sparc
-
solaris_10
Compile and execute the following testcase with MToolkit.
1- Type test in the 2 TextFields of the top window
2- Click on the "Open JDialog" button
3- Close the "Modal JDialog" window
4- Try to type text in the 2 TextFields. The 2 TextFields are no more editable.
In addition, when the Modal window is opened, the mouse cursor is a text cursor in the TextFields instead of an arrow as in XToolkit.
% cat Test.java
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Test {
public static void main(String[] args) {
final Frame f = new Frame("Top Window");
f.setLayout(new BorderLayout());
f.setBounds(0, 0, 500, 110);
f.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent ev) {
System.exit(0);
}
});
JTextField text = new JTextField();
JTextField text1 = new JTextField();
JButton b = new JButton("Open JDialog");
JPanel topPanel = new JPanel();
topPanel.setLayout(new BorderLayout());
topPanel.add( text, BorderLayout.NORTH );
topPanel.add( text1, BorderLayout.CENTER );
topPanel.add( b, BorderLayout.SOUTH );
f.add(topPanel, BorderLayout.NORTH);
f.setVisible(true);
b.addActionListener( new ActionListener(){
public void actionPerformed(ActionEvent e)
{
JDialog jd = new JDialog( f, "Modal JDialog");
JButton but = new JButton("JButton");
jd.setMinimumSize( new Dimension ( 200,100 ) );
jd.setPreferredSize( new Dimension (200,100 ) );
jd.setModal(true);
jd.setLocation(500,100);
jd.setLayout(new BorderLayout());
jd.getContentPane().setLayout(new BorderLayout());
jd.getContentPane().add( but);
jd.setVisible(true);
jd.pack();
jd.setMinimumSize(jd.getPreferredSize());
}
});
}
}
1- Type test in the 2 TextFields of the top window
2- Click on the "Open JDialog" button
3- Close the "Modal JDialog" window
4- Try to type text in the 2 TextFields. The 2 TextFields are no more editable.
In addition, when the Modal window is opened, the mouse cursor is a text cursor in the TextFields instead of an arrow as in XToolkit.
% cat Test.java
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Test {
public static void main(String[] args) {
final Frame f = new Frame("Top Window");
f.setLayout(new BorderLayout());
f.setBounds(0, 0, 500, 110);
f.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent ev) {
System.exit(0);
}
});
JTextField text = new JTextField();
JTextField text1 = new JTextField();
JButton b = new JButton("Open JDialog");
JPanel topPanel = new JPanel();
topPanel.setLayout(new BorderLayout());
topPanel.add( text, BorderLayout.NORTH );
topPanel.add( text1, BorderLayout.CENTER );
topPanel.add( b, BorderLayout.SOUTH );
f.add(topPanel, BorderLayout.NORTH);
f.setVisible(true);
b.addActionListener( new ActionListener(){
public void actionPerformed(ActionEvent e)
{
JDialog jd = new JDialog( f, "Modal JDialog");
JButton but = new JButton("JButton");
jd.setMinimumSize( new Dimension ( 200,100 ) );
jd.setPreferredSize( new Dimension (200,100 ) );
jd.setModal(true);
jd.setLocation(500,100);
jd.setLayout(new BorderLayout());
jd.getContentPane().setLayout(new BorderLayout());
jd.getContentPane().add( but);
jd.setVisible(true);
jd.pack();
jd.setMinimumSize(jd.getPreferredSize());
}
});
}
}
- relates to
-
JDK-6682966 Interaction problem between Java and C++ (JNI and JAWT) using J2SE 1.6.0
- Closed