Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6477798

Very Tall JToolbar is too far away when dragging

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 6
    • Fix Version/s: None
    • Component/s: client-libs

      Description

      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 :
      When a JToolbar is very tall/has a lot of height to it, dragging it can seem odd the further the mouse is down from its starting y coordinate. Dragging always seems to start the drag window at 0 and not where the mouse is. This leads to a large gap between the window and the mouse making it awkward to drag.

      A second issue may be that the window is not the same height as the JToolBar but on the other hand this seems to make it easier to drag the JToolBar around.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run this test, drag from the bottom of the JToolBar and see how far away the window is.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      the window to be flush with the mouse
      ACTUAL -
      the window is very far away

      REPRODUCIBILITY :
      This bug can be reproduced always.

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

      public class JToolBarProblem 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 JToolBarProblem());
         }

         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 :
      start drag from top area.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Imported:
              Indexed: