0

I have a Swing application, And when i run VoiciOver Utility it announce Swing Application as Java.

For example:

import javax.swing.*;
import java.awt.event.*;
public class Menu extends JFrame{
public Menu()
{
    super("Menu example");

    JMenu file = new JMenu("File");
    file.setMnemonic('F');
    JMenuItem newItem = new JMenuItem("New");
    newItem.setMnemonic('N');
    file.add(newItem);
    JMenuItem openItem = new JMenuItem("Open");
    openItem.setMnemonic('O');
    file.add(openItem); 
    JMenuItem exitItem = new JMenuItem("Exit");
    exitItem.setMnemonic('x');
    file.add(exitItem);

    //adding action listener to menu items
    newItem.addActionListener(
        new ActionListener(){
            public void actionPerformed(ActionEvent e)
            {
                System.out.println("New is pressed");
            }
        }
    );
    openItem.addActionListener(
        new ActionListener(){
            public void actionPerformed(ActionEvent e)
            {
                System.out.println("Open is pressed");
            }
        }
    );
    exitItem.addActionListener(
        new ActionListener(){
            public void actionPerformed(ActionEvent e)
            {
                System.out.println("Exit is pressed");
            }
        }
    );                      
    JMenuBar bar = new JMenuBar();
    setJMenuBar(bar);
    bar.add(file);

    getContentPane();
    setSize(200, 200);
    setVisible(true);
}

public static void main(String[] args)
{
    Menu app = new Menu();
    app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}

If we try this example with voiceOver utility,it announces the application as "java Menu example window".

can some one help me in resolving this issue?

varuag
  • 81
  • 7

1 Answers1

0

You can set the com.apple.mrj.application.apple.menu.about.name property to change the displayed name, as shown here.

trashgod
  • 203,806
  • 29
  • 246
  • 1,045