Here you can find the source of createToolBar()
public static JToolBar createToolBar()
//package com.java2s; //License from project: Creative Commons License import javax.swing.BorderFactory; import javax.swing.JToolBar; public class Main { public static JToolBar createToolBar() { JToolBar tb = new JToolBar(); tb.setFloatable(false);//from w w w . ja v a 2 s.c om tb.setRollover(true); tb.setBorder(BorderFactory.createEmptyBorder(1, 0, 0, 0)); return tb; } }