Reputation: 418
i am trying to add Separate between the JMenuBar
and JToolBar
because it's coming like their are no space between JMenuBar
and JToolBar
for example can i make JToolBar
bold or something
JPanel addTable = new JPanel(new BorderLayout());
addTable.add(table,BorderLayout.NORTH);
addTable.add(toolbar, BorderLayout.NORTH);
Container cp=getContentPane();
cp.add(addTable);
Upvotes: 1
Views: 922
Reputation: 418
also there are some tutorial for JPanel Border here Border tutorial
Upvotes: 0
Reputation: 208984
You can use a MatteBorder
for the JToolBar
and just set the top edge
JToolBar toolBar = new JToolBar("ToolBar");
MatteBorder matteBorder = new MatteBorder(1, 0, 0, 0, Color.BLACK);
toolBar.setBorder(matteBorder);
This will give you a line on top of the tool bar, one pixel color black
Disregard the complete image. Its just some code I had handy with a menu bar in it.
Notice the line at the top of the toolbar to give more distinction in separation. You can play around with the pixel thickness and color. If you want it a little more subtle, tou can use a color like light_gray or gray. Your choice
Upvotes: 1