I created a JToolBar that i eventually want to use in an application. When i hook the JToolBar into one of my apps the Buttons dont seem to line up right. I want to shift them over but nothing seems to work. Any ides on how i can do this?
Code:import java.io.*; import java.awt.*; import javax.swing.*; import java.awt.event.*; public class ToolBar extends JToolBar{ JButton redo; JButton refresh; JButton help; public ToolBar(){ setFloatable(false); redo = new JButton(); redo.setIcon(new ImageIcon("C:" + File.separator + "JavaLFGraphicsRepository" + File.separator + "toolbarButtonGraphics" + File.separator + "general" + File.separator + "Redo24.gif")); redo.setToolTipText("Update Database"); refresh = new JButton(); refresh.setIcon(new ImageIcon("C:" + File.separator + "JavaLFGraphicsRepository" + File.separator + "toolbarButtonGraphics" + File.separator + "general" + File.separator + "Refresh.24.gif")); refresh.setToolTipText("Refresh Table"); help = new JButton(); help.setIcon(new ImageIcon("C:" + File.separator + "JavaLFGraphicsRepository" + File.separator + "toolbarButtonGraphics" + File.separator + "general" + File.separator + "Help24.gif")); help.setToolTipText("Help"); //add(Box.createVerticalStrut(1)); // Pushes buttons all the way over to the right. //addSeparator(new Dimension(0,100)); // does nothing add(help); add(redo); add(refresh); } }




Reply With Quote