変えてみたLook&Feel
public class Main {
public static void main(String[] args) {
try {
String osName = System.getProperty("os.name");
if (osName.contains("Mac")) {
System.setProperty("apple.laf.useScreenMenuBar", "true");
}
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e1) {
}
}
}
しかし、オンラインで例外を取得するUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName())
java.lang.NullPointerException
Failed to create resources from application bundle. Using Java-based resources.
at java.io.File.<init>(File.java:222)
at com.apple.resources.LoadNativeBundleAction.run(MacOSXResourceBundle.java:60)
at com.apple.resources.LoadNativeBundleAction.run(MacOSXResourceBundle.java:33)
at java.security.AccessController.doPrivileged(Native Method)
at com.apple.resources.MacOSXResourceBundle.getMacResourceBundle(MacOSXResourceBundle.java:29)
at com.apple.resources.MacOSXResourceBundle.getMacResourceBundle(MacOSXResourceBundle.java:24)
at com.apple.laf.AquaLookAndFeel.initResourceBundle(AquaLookAndFeel.java:244)
at com.apple.laf.AquaLookAndFeel.initComponentDefaults(AquaLookAndFeel.java:260)
at com.apple.laf.AquaLookAndFeel.getDefaults(AquaLookAndFeel.java:227)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:520)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:564)
at org.camobap.osx.Main.main(Main.java:26)
誰かがこの問題を回避するために私を助けてくれますか?
アップデート:
jdk1.7.0_09