menuBar = new JMenuBar();
JMenu formatMenu = new JMenu("Justify");
formatMenu.setMnemonic('J");
MenuAction leftJustifyAction = new MenuAction("Left",
new ImageIcon("left.gif"));
MenuAction rightJustifyAction = new MenuAction("Right",
new ImageIcon("right.gif"));
MenuAction centerJustifyAction = new MenuAction("Center",
new ImageIcon("center.gif"));
MenuAction fullJustifyAction = new MenuAction("Full",
new ImageIcon("full.gif"));
JMenuItem item;
item = formatMenu.add(leftJustifyAction);
item.setMnemonic('L");
item = formatMenu.add(rightJustifyAction);
item.setMnemonic('R");
item = formatMenu.add(centerJustifyAction);
item.setMnemonic('C");
item = formatMenu.add(fullJustifyAction);
item.setMnemonic('F");
menuBar.add(formatMenu);
menuBar.setBorder(new BevelBorder(BevelBorder.RAISED));