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

Introduce Toolbar containers

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 1.4.2
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:

      Description



      Name: rmT116609 Date: 09/08/2004


      A DESCRIPTION OF THE REQUEST :
      It woulb be great if Swing can offer some kinds of toolbar containers which enable these features:
      1. Toolbar container can be contain several toolbars
      2. The toolbars can be smoothly moved in the toolbar container
      3. The container support automatic wrapping-in feature as the Windows forms in .Net

      JUSTIFICATION :
      Implementing this feature will help better application with great GUI.

      ACTUAL -
      There can be only one toolbar in the application, the toolbar can not be divided into several pieces

      ---------- BEGIN SOURCE ----------
      import java.awt.BorderLayout;
      import java.awt.Container;

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

      public class ToolbarHandling {
          
          static {
              try {
                  UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
          
          public ToolbarHandling() {
              final JFrame frame = new JFrame("Test (Simple toolbar)");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              
              JToolBar toolbar1 = new JToolBar();
              toolbar1.add(new JButton("-- toolbar one ---"));
              
              JToolBar toolbar2 = new JToolBar();
              toolbar2.add(new JButton("-- toolbar two ---"));
              
              Container contentPane = frame.getContentPane();
              contentPane.add(toolbar1, BorderLayout.NORTH);
              contentPane.add(toolbar2, BorderLayout.EAST);
              
              SwingUtilities.invokeLater(new Runnable() {
                  public void run() {
                      frame.pack();
                      frame.setSize(600, 200);
                      frame.show();
                  }
              });
          }

          public static void main(String[] args) {
              new ToolbarHandling();
          }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Write your own component
      (Incident Review ID: 302285)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              leifs Leif Samuelsson (Inactive)
              Reporter:
              rmandalasunw Ranjith Mandala (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: