How can I create multiple floatable/dockable toolbars/palettes/views which stay inside the application frame (unlike Swing JToolBars)? Is it poosible to have such a framework for AWT also?

John Zukowski

To keep toolbars within the application frame, you'll need to create your own JToolBar-like component that keeps the floating toolbar within a JInternalFrame instead of a JFrame. The UI for the JToolBar class requires that the floating frame be a JFrame: protected JFrame createFloatingFrame(JToolBar toolbar) and the drag window be a DragWindow (which extends Window).

As far as dealing multiple toolbars goes, if you want to stick with JToolBar... You will need to create a new ToolBarUI and override public void setFloating(boolean b, Point p), protected void dragTo(Point position, Point origin), and protected void floatAt(Point position, Point origin) to deal with adding multiple toolbars to a single constraint.

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact