JMenu options = new JMenu("Options");
bar.add(options);
JMenuItem fontItem = new JMenuItem("Font");
options.add(fontItem);
final FontChooser fontChooser = new FontChooser(parent);
fontItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
fontChooser.setVisible(true);
Font font = fontChooser.getSelectedFont();
if (font == null) {
System.out.println("Nothing selected");
return;
}
System.out.println(font);