-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
6
-
generic
-
generic
Please run the provided test
Notice that when mouse slowly enters either frames it becomes selected
Move the mouse cursor from one frame *title bar* to another frame's *title bar*
If you do it several times back and forth you noticed that frames are out of sync -
the mouse is over one frame, but the other one is still selected
You shold move the mouse quickly to reproduce it
Expected behavour:
If mouse is over the internal frame, it should be selected
Current behavour:
If you move the mouse quickly they become out of sync
JDK 6.0
import javax.swing.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.beans.PropertyVetoException;
public class JifProblem {
public static void main(String[] args) throws Exception {
final JFrame frame = new JFrame("JInternalFrame problem");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JDesktopPane pane = new JDesktopPane();
JInternalFrame f1 = getInternalFrame();
f1.setBounds(15, 10, 300, 50);
pane.add(f1);
JInternalFrame f2 = getInternalFrame();
f2.setBounds(330, 10, 300, 50);
pane.add(f2);
frame.add(pane);
frame.setSize(650, 150);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
static private JInternalFrame getInternalFrame() {
final JInternalFrame frame = new JInternalFrame("First frame");
frame.setResizable(true);
frame.addMouseListener(new MouseAdapter() {
public void mouseEntered(MouseEvent e) {
try {
frame.setSelected(true);
} catch (PropertyVetoException e1) {
e1.printStackTrace();
}
}
});
frame.setVisible(true);
return frame;
}
}
Notice that when mouse slowly enters either frames it becomes selected
Move the mouse cursor from one frame *title bar* to another frame's *title bar*
If you do it several times back and forth you noticed that frames are out of sync -
the mouse is over one frame, but the other one is still selected
You shold move the mouse quickly to reproduce it
Expected behavour:
If mouse is over the internal frame, it should be selected
Current behavour:
If you move the mouse quickly they become out of sync
JDK 6.0
import javax.swing.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.beans.PropertyVetoException;
public class JifProblem {
public static void main(String[] args) throws Exception {
final JFrame frame = new JFrame("JInternalFrame problem");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JDesktopPane pane = new JDesktopPane();
JInternalFrame f1 = getInternalFrame();
f1.setBounds(15, 10, 300, 50);
pane.add(f1);
JInternalFrame f2 = getInternalFrame();
f2.setBounds(330, 10, 300, 50);
pane.add(f2);
frame.add(pane);
frame.setSize(650, 150);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
static private JInternalFrame getInternalFrame() {
final JInternalFrame frame = new JInternalFrame("First frame");
frame.setResizable(true);
frame.addMouseListener(new MouseAdapter() {
public void mouseEntered(MouseEvent e) {
try {
frame.setSelected(true);
} catch (PropertyVetoException e1) {
e1.printStackTrace();
}
}
});
frame.setVisible(true);
return frame;
}
}