United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 7154048 [macosx] At least drag twice, the toolbar can be dragged to the left side.
7154048 : [macosx] At least drag twice, the toolbar can be dragged to the left side.

Details
Type:
Bug
Submit Date:
2012-03-15
Status:
Closed
Updated Date:
2012-05-23
Project Name:
JDK
Resolved Date:
2012-05-23
Component:
client-libs
OS:
os_x
Sub-Component:
java.awt
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
7u4
Fixed Versions:
8

Related Reports
Backport:
Relates:
Relates:

Sub Tasks

Description
Testsuite name: swing regression

Test case:closed/javax/swing/plaf/basic/BasicToolBarUI/4331392/bug4331392.java 

JDK/JRE tested: jdk-7u4-ea-macosx-amd64.tar.gz (7u4b15)

OS/architecture: x64

Reproducible: Always

Reproducible on machine: Mac mini 10.7 (Memory 4GB 1067MHz DDR3;Processor 2.4GHz Intel Core 2 Duo)   

Is it a platform specific regression: N

Is it a Regression: N

Test run log location:http://jsqalab.us.oracle.com/results/Evergreen/7u4/b15/swing/Macmini10.7-x64/results-reg/workDir/closed/javax/swing/plaf/basic/BasicToolBarUI/4331392/bug4331392.jtr
Test run result location: http://jsqalab.us.oracle.com/results/Evergreen/7u4/b15/swing/Macmini10.7-x64/results-reg

Steps to reproduce:

1.Download the workspace
http://hg.openjdk.java.net/jdk7/swing/jdk and
http://closedjdk.us.oracle.com/jdk7/swing/jdk/test/closed

and unzip to /var/root/swing-reg/

2. Install test bundle JDK7u4b15 from http://jre.us.oracle.com/java/re/jdk/7u4/promoted/ea/b15/bundles/macosx-amd64/

to /private/var/root/Library/Java/JavaVirtualMachines/1.7.0_04.jdk-b15

3. Install Jtreg from http://jre.us.oracle.com/java/re/jtreg/4.1/promoted/latest/binaries/latest/jtreg/

locate at /var/root/swing-reg

4. Create results at /var/root/swing-reg

5. Modify the test_swing.sh as:

/var/root/swing-reg/jtreg/linux/bin/jtreg -cpa:/var/root/swing-reg/ws/test -g -v -m -jdk:/var/root/Library/Java/JavaVirtualMachines/1.7.0_04.jdk-b15/jdk1.7.0_04/1.7.0.jdk/Contents/Home -r:/var/root/swing-reg/results/reportdir -w:/var/root/swing-reg/results/workdir /var/root/swing-reg/ws/test

6. Go to /var/root/swing-reg, and run the command : sh reg_swing.sh

7.After Jtreg launched, choose testlist filter:

  closed/javax/swing/plaf/basic/BasicToolBarUI/4331392/bug4331392.java 
   
8.Choose keyword and mark it as manual
9.run the case

Instruction:

Try to dock toolbar across all the edges of applet. If you succeed, then test is passed.

Actual behavior:

At least drag twice, the toolbar can be dragged to the left side. Refer to the attachment. And the same issue on closed/javax/swing/JToolBar/4251592/bug4251592.java,but when click done button,it is auto pass.

                                    

Comments
EVALUATION

changeset: http://hg.openjdk.java.net/jdk8/awt/jdk/rev/0fad89bd606b
                                     
2012-05-03
EVALUATION

[SQE]
  Risk: medium
  To test the fix run the tests:
  test/java/awt/Mouse/EnterExitEvents/ResizingFrameTest.java
  test/java/awt/Mouse/EnterExitEvents/DragWindowTest.java
  test/java/awt/Mouse/EnterExitEvents/DragWindowOutOfFrameTest.java	 
[SQE]
                                     
2012-05-03
EVALUATION

Assume we are dragging a window over a frame. After dragging a window and released a button the MAC OS X native system puts mouse entered event to a dragging window. So the window peer starts mouse exited process from the frame. Than window peer starts to enter to the frame so the mouse release events goes not to component where the mouse was initially clicked.
                                     
2012-03-22
EVALUATION

The attached TestDrag class shows the problem.

A JLbale has a mouse listener which tracks mouseReleased event.
Drag mouse from the the JLable to JButton. The 'released' string is printed.
Drag mouse from the the JLable to JButton the second time. The 'released' string is not printed.

This is because in the second time there are two events MouseExited and Mouse Entered before the MouseReleased. So the MouseReleased events goes to the JButton instead of the JLabel.
                                     
2012-03-21
PUBLIC COMMENTS

Code to reproduce:
--------------------------
mport java.awt.BorderLayout;
import javax.swing.*;

public class MyToolBar {

    public static void main(String[] args) throws Exception {


        //UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");

        SwingUtilities.invokeAndWait(new Runnable() {

            @Override
            public void run() {
                JFrame frame = new JFrame("ToolBar test");
                frame.setSize(400, 400);
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);


                //JToolBar tbar = new JToolBar(JToolBar.VERTICAL);
                JToolBar tbar = new JToolBar(JToolBar.TOP);

                tbar.add(new JButton("A"));
                tbar.add(new JButton("B"));
                tbar.add(new JButton("C"));

                JButton b = new JButton("Hello");
                frame.getContentPane().add(b, BorderLayout.CENTER);
                frame.getContentPane().add(tbar, BorderLayout.EAST);
                frame.setVisible(true);
            }
        });

    }
}

--------------------------
                                     
2012-03-20
EVALUATION

Reproduced. Toolbar docking seems utterly broken on Mac. In bug4331392, sometimes instead of docking we get an original toolbar, detached toolbar somewhere aside and the outlay of toolbar moving together with it but far away. 
In bug4251592 it is even more weird: sometimes a detached toolbox move invisible behind the instruction window together with outlay.

Then again, it is broken in jdk8 on XAWT as well, if not so bad. Test bug4251592 shows that one can dock toolbar horizontally but instead of vertical toolbar, one get still a horizontal one on top with buttons filling all the area.
                                     
2012-03-16



Hardware and Software, Engineered to Work Together