-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
6
-
Cause Known
-
x86
-
solaris_10
FULL PRODUCT VERSION :
java version "1.6.0-rc"
Java(TM) SE Runtime Environment (build 1.6.0-rc-b95)
ADDITIONAL OS VERSION INFORMATION :
SunOS 5.10 Generic i86pc i386 i86pc
A DESCRIPTION OF THE PROBLEM :
While evaluating what I thought was 4311805, I was able to target the area where the bad location takes control. The code is in sun.awt.X11.XDecoraterPeer. The particular method is handleConfigureNotifyEvent. The particular branch of code is the one preceded with this javadoc:
// CDE/MWM/Metacity/Sawfish bug: if shell is resized using
// top or left border, we don't receive synthetic
// ConfigureNotify, only the one from X with zero
// coordinates. This is the workaround to get real
// location, 6261336
What I am seeing is this:
1. Start up the test.
2. Drag out the toolbar. Put it back in the frame.
3. Continue 2 onward until the JToolBar pops up at 0,0 when released from dragging. I pull out to the left, down then up a little and release. This typically recreates the problem after 2-4 tries.
The code in question comes in with coordinates that are not 0, 0 on the event. When queryXLocation returns its point it is 0,0. At this juncture the coordinates for the JToolBars dialog are set to 0, 0, which causes the toolbar to pop up in the left hand corner.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Ive been only able to recreate this in Java 6. No luck in 4 or 5. Run this test and begin dragging out:
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The JToolBar to occupate where I release the button
ACTUAL -
It can pop up to 0,0.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class JToolBar6261336Regression implements Runnable {
static JFrame testFrame;
public static JToolBar toolBar;
public static void main(String[] argv) {
try{
int i = Integer.parseInt(argv[0]);
if(i == 0) UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
else if(i == 1) UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
}catch(Exception x){}
SwingUtilities.invokeLater(new JToolBar6261336Regression());
}
public void run(){
testFrame = new JFrame("JToolBar() Test");
testFrame.setSize(300, 300);
testFrame.setLocation(500,500);
testFrame.getContentPane().setLayout(new BorderLayout());
toolBar = new JToolBar();
toolBar.add(new JButton("Test button"));
testFrame.getContentPane().add(toolBar);
testFrame.setVisible(true);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
None at this time.
Release Regression From : mustang
The above release value was the last known release where this
bug was not reproducible. Since then there has been a regression.
java version "1.6.0-rc"
Java(TM) SE Runtime Environment (build 1.6.0-rc-b95)
ADDITIONAL OS VERSION INFORMATION :
SunOS 5.10 Generic i86pc i386 i86pc
A DESCRIPTION OF THE PROBLEM :
While evaluating what I thought was 4311805, I was able to target the area where the bad location takes control. The code is in sun.awt.X11.XDecoraterPeer. The particular method is handleConfigureNotifyEvent. The particular branch of code is the one preceded with this javadoc:
// CDE/MWM/Metacity/Sawfish bug: if shell is resized using
// top or left border, we don't receive synthetic
// ConfigureNotify, only the one from X with zero
// coordinates. This is the workaround to get real
// location, 6261336
What I am seeing is this:
1. Start up the test.
2. Drag out the toolbar. Put it back in the frame.
3. Continue 2 onward until the JToolBar pops up at 0,0 when released from dragging. I pull out to the left, down then up a little and release. This typically recreates the problem after 2-4 tries.
The code in question comes in with coordinates that are not 0, 0 on the event. When queryXLocation returns its point it is 0,0. At this juncture the coordinates for the JToolBars dialog are set to 0, 0, which causes the toolbar to pop up in the left hand corner.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Ive been only able to recreate this in Java 6. No luck in 4 or 5. Run this test and begin dragging out:
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The JToolBar to occupate where I release the button
ACTUAL -
It can pop up to 0,0.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class JToolBar6261336Regression implements Runnable {
static JFrame testFrame;
public static JToolBar toolBar;
public static void main(String[] argv) {
try{
int i = Integer.parseInt(argv[0]);
if(i == 0) UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
else if(i == 1) UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
}catch(Exception x){}
SwingUtilities.invokeLater(new JToolBar6261336Regression());
}
public void run(){
testFrame = new JFrame("JToolBar() Test");
testFrame.setSize(300, 300);
testFrame.setLocation(500,500);
testFrame.getContentPane().setLayout(new BorderLayout());
toolBar = new JToolBar();
toolBar.add(new JButton("Test button"));
testFrame.getContentPane().add(toolBar);
testFrame.setVisible(true);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
None at this time.
Release Regression From : mustang
The above release value was the last known release where this
bug was not reproducible. Since then there has been a regression.
- relates to
-
JDK-6261336 REG: Choice's drop-down appears at wrong location when placed inside a scrollpane, XToolkit
-
- Closed
-