Okay, that's why I used to make Swing applications, and I know if you want to display a different name for the application menu (on a Mac, which usually has the "Preferences" and "Exit" System.setProperty("com.apple.mrj.application.apple.menu.about.name", "App name"); ), you have to use: System.setProperty("com.apple.mrj.application.apple.menu.about.name", "App name"); and it must be done before creating the JFrame. I did this, but it continues to show the name of my main class as the name of the menu, as if I did not write this line of code at all. I googled for this problem, but could not find anything useful, and then I just searched here, but everyone who had a similar problem had Java 1.5, 1.6 or 1.7 working. So I thought that maybe this is due to my current version of Java 1.8.
This , this, and this do not work. This , this, and this sent me to outdated information, or the links no longer worked. In addition, I am running Mac 10.8.
Any suggestions and answers are welcome.
Update:
here is the code i originally had:
package bouncing_off_axes; public class Main { public static void main(String[] args) { System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Physics Engine Practice - Bouncing Balls"); SimulationController view = new SimulationController("Test"); } }
And here is the solution that trashgod provided to someone else:
package bouncing_off_axes; import java.awt.Color; import java.awt.Dimension; import java.awt.EventQueue; import javax.swing.BorderFactory; import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JPanel; public class NewMain { public static void main(String[] args) { System.setProperty("apple.laf.useScreenMenuBar", "true"); System.setProperty( "com.apple.mrj.application.apple.menu.about.name", "Name"); EventQueue.invokeLater(new Runnable() { @Override public void run() { JFrame frame = new JFrame("Gabby"); final JPanel dm = new JPanel() { @Override public Dimension getPreferredSize() { return new Dimension(320, 240); } }; dm.setBorder(BorderFactory.createLineBorder(Color.blue, 10)); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(dm); frame.pack(); frame.setLocationByPlatform(true); JMenuBar menuBar = new JMenuBar(); JMenu fileMenu = new JMenu("File"); menuBar.add(fileMenu); frame.setJMenuBar(menuBar); frame.setVisible(true); } }); } }
And apparently, I need 10 reputation to send images, so I canβt show the result, but it didnβt work.