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

Dragged out JToolBar ocupates unexpected position on screen

    Details

      Description



      Name: egR10015 Date: 02/10/2000



      Separate window of JToolBar ocupates unexpected position on screen when JToolBar is
      dragged out.

      JFrame window of the following test contains JToolBar.

      First, drag out the JToolBar. JToolBar's window will get
      exactly at the point where mouse button was released.
      Put JToolBar back to frame, then drag it out again. When you will release mouse button,
      window with JToolBar will be placed at random location on screen but never on that
      position where you released mouse button.
      If you repeat these steps (put JToolBar back to frame and drag it out), you can always
      see incorrect location of JToolBar's window.

      --------------------test.java---------------------------------------------
      import java.awt.BorderLayout;

      import javax.swing.JFrame;
      import javax.swing.JButton;
      import javax.swing.JToolBar;

      public class test {
         static JFrame testFrame;
         public static JToolBar toolBar;

         public static void main(String[] argv) {
            testFrame = new JFrame("JToolBar() Test");
            testFrame.setSize(300, 300);
            testFrame.getContentPane().setLayout(new BorderLayout());
            
            toolBar = new JToolBar();
            toolBar.add(new JButton("Test button"));
            
            testFrame.getContentPane().add(toolBar);
            testFrame.setVisible(true);
         }
      }
      ----------------------------------------------------------------------
      ======================================================================

      ======================================================================

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              eugsunw Eug Eug (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Imported:
                Indexed: