JToolBar has the disadvantage that it cannot be made invisible, because it contains at least one internal JPanel (tested on Linux). Therefore we need a replacement that holds together some buttons in a line with some reasonable gaps. As a treat you can use varargs to add the components.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.