Posts Tagged ‘Java. Swing’

Multiple floating toolbars with Swing

March 18, 2013 1 comment

These are my holidays, I should be sitting at the beach, not coding. Unfortunately I can’t; and since when I am bored I do things I like, coding is still one good way to kill some time. So I was restarting an old pet project of mine, some kind of editor and I pretty early ran into a problem: The Java gods have brought us floating toolbars that can be docked to the sides of a BorderLayout. Unfortunately the BorderLayout is the only layout they work with und unfortunately a BorderLayout can just hold one component in each of its border regions, so you can’t have more than one JToolbar on each side, which unfortunately renders the floating functionality pretty useless by default. They might have thought “YAGNI”, when the idea of multiple toolbars next to each other crossed their minds, I don’t know. Unfortunately “I am gonna need it”, but fortunately there is remedy. Read more…

Categories: Swing Tags: , ,