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

Windows L&F toolbars don't return to original location when closed

XMLWordPrintable

    • beta
    • generic, x86
    • generic, windows_nt



      Name: rk38400 Date: 11/10/98


      /*

      Drag a Windows L&F toolbar to create a floating
      window. When you close the floating window, the
      toolbar will return to the NORTH location of
      the parent container instead of the originating
      location.

      The code below demonstrates the problem. Drag the
      toolbar that contains the button Press Me Also off
      and then close the window. It will show up under
      the NORTH toolbar.

      I havn't looked at the code to find the problem,
      sorry.

      */

      import java.awt.*;
      import javax.swing.*;

      public class toolbarBug {

          public static void main(String args[]) {

      try {
      UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
      } catch (Exception e) {}

      // create something to hold toolbars

      JFrame frame = new JFrame();
      frame.getContentPane().setLayout(new BorderLayout());

      // create some toolbars

      JToolBar tb1 = new JToolBar();
      JToolBar tb2 = new JToolBar();

      tb1.add(new JButton("Press Me"));
      tb2.add(new JButton("Press Me Also"));

      // add the toolbars to the frame

      frame.getContentPane().add(tb1, BorderLayout.NORTH);
      frame.getContentPane().add(tb2, BorderLayout.WEST);

      // show the frame

      frame.show();

          }

      }
      (Review ID: 42422)
      ======================================================================

      Name: krT82822 Date: 08/16/99


      When a JToolbar is detached and then reattached to a container, it will always be placed NORTH regardless of where it was detached from. It should, either be placed where it was detached from last, or at least where it was placed initially. I have a panel where it looks really bad for a toolbar being on the top of the screen.
      (Review ID: 93969)
      ======================================================================

            kereminsunw Konstantin Eremin (Inactive)
            rkarsunw Ralph Kar (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: