Here you can find the source of addToolbar(JPanel panel, JToolBar bar)
public static void addToolbar(JPanel panel, JToolBar bar)
//package com.java2s; import java.awt.BorderLayout; import javax.swing.JPanel; import javax.swing.JToolBar; public class Main { public static void addToolbar(JPanel panel, JToolBar bar) { panel.add(bar, BorderLayout.PAGE_START); }// w ww. ja v a 2s .c o m }