CommandBar class.
One thing I was sure I wanted were icons on the main menu bar. This departs from tradition, but it lets the expert user switch off the menu bar in favor of a more compact set of icons. In the first graphic, you see the same set of menu choices, first as a menu and next as an icon bar.
My goal in having the icon version is to provide an expert bar for experienced users. That might look like this.
The expert version still has the full main menu. As the graphic shows, the choices are flat until the mouse pointer is above them.
Most commercial icon collections have a tiny 16 by 16 pixel version and a more readable 24 by 24 version. The tiny ones are used in dropdown menus. (Next to the word "Print" the printer icon doesn't need to be very clear.) My icons are 20 by 20 — a size that combines with text and still lets the icons be clear.
(Aside - I'm happy with most of the icons I painted, but I'm not so sure about Edit and I'm definitely searching for a better Insert. I won't be offended if someone suggests hiring a genuine artist.)
![]() |
As you see in the graphic on the left, the same menu and icon bar can be vertical. Not shown here, if there is no icon, the command bar will use the name instead. If the name is used, it is turned ninety degrees for the vertical bar, so that bar doesn't get unnecessarily wide. You'll see an example in the application framework sample. |
I tossed in the vertical button as a quick suggestion of what you would be getting, and a reminder that Graphics2D can do things like rotating text.
The LaunchCommandBars applet is in the applets package. The CommandBar and supporting classes AppFrame, Command and Commands are in the appFramework package.
file.gif |
edit.gif |
find.gif |
insert.gif |
macro.gif |
view.gif |
window.gif |
help.gif |
edit-dis.gif |
find-dis.gif |
||||||
new.gif |
open.gif |
save.gif |
saveAs.gif |
print.gif |
|||
new-dis.gif |
open-dis.gif |
save-dis.gif |
saveAs-dis.gif |
print-dis.gif |
|||
cut.gif |
copy.gif |
paste.gif |
delete.gif |
redo.gif |
undo.gif |
||
cut-dis.gif |
copy-dis.gif |
paste-dis.gif |
delete-dis.gif |
redo-dis.gif |
undo-dis.gif |
||
up.gif |
down.gif |
left.gif |
right.gif |
top.gif |
bottom.gif |
home.gif |
end.gif |
up-dis.gif |
down-dis.gif |
left-dis.gif |
right-dis.gif |
top-dis.gif |
bottom-dis.gif |
home-dis.gif |
end-dis.gif |
docks.gif |
dock-top.gif |
dock-bottom.gif |
dock-left.gif |
dock-right.gif |
docks-h.gif |
docks-v.gif |
|
fly-horizontal.gif |
fly-vertical.gif |
docks-h2v.gif |
docks-v2h.gif |