JToolBar in window

45 Views Asked by At

I have a JToolBar that is currently on the border but can be put in its own smaller window if dragged over. I want to have this JToolBar start in the window rather than me having to drag it out. I did some research and the few other examples of this said that I should implement BasicToolBarUI but I have no idea how to use it. Can I get any recommendations for this problem?

1

There are 1 best solutions below

0
camickr On

You don't need to implement BasicToolBarUI, you need to use methods from the UI.

JToolBar toolbar = new JToolBar();
BasicToolBarUI ui = (BasicToolBarUI)toolBar.getUI();
ui.setFloatingLocation(300, 300);
ui.setFloating(true, null);