File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes a few questions about JToolBar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "a few questions about JToolBar" Watch "a few questions about JToolBar" New topic

a few questions about JToolBar

Rusty Shackleford
Ranch Hand

Joined: Jan 03, 2006
Posts: 490
I created a JToolBar and placed it on a JFrame, underneath a JMenuBar.

The problem I am having is it won't connect right below the JMenuBar, there is a dotted line(not sure what it is called) between the menu bar and tool bar. Clicking on that dotted line and sliding it up a bit will connect it. Is there a way to get this behavior by default? I looked at suns tutorials and JToolBAr docs, but nothing obvious jumped out.

Also, why did I have to call SetOrientation and pass it VERTICAL to get it to lay out horizontally across the JFrame? Passing it HORIZONTAL laid it out vertically on the left side of the JFrame.

"Computer science is no more about computers than astronomy is about telescopes" - Edsger Dijkstra
Rusty Shackleford
Ranch Hand

Joined: Jan 03, 2006
Posts: 490
I got it working correctly, thanks anyway
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46424
Glad you got it sorted, Rusty. The reason we didn't reply was because we didn't know how to help.

But how did you sort out the problem?

I agree. Here's the link:
subject: a few questions about JToolBar
It's not a secret anymore!