B4J Question OSX native Menu

madru

Active Member
Licensed User
Longtime User
Good morning,

how can I implement a native Menu on OSX?

h***s://developer.apple.com/library/mac/documentation/Java/Conceptual/Java14Development/07-NativePlatformIntegration/NativePlatformIntegration.html

THX :)
 

madru

Active Member
Licensed User
Longtime User
Hi Erel,

yes, that will solve 95% of it :)

but the program title does not show up in the Menubar and how do we get the Mac typical Preferences entry in the menu ?
 
Upvote 0

madru

Active Member
Licensed User
Longtime User
nope, the bar shows java and the underneath menu shows the package name. Question: what will be the program name ?
 
Upvote 0

madru

Active Member
Licensed User
Longtime User
OK, if there is no other way to do it

what about the preferences and about menu, is there workaround as well?

B4X:
public class MyApplicationAdapter extends ApplicationAdapter
{
private DesktopShield handler; public MyApplicationAdapter(DesktopShield handler){this.handler = handler;}

public void handleQuit(ApplicationEvent e){System.exit(0);}

public void handleAbout(ApplicationEvent e)
 {
 // tell the system we're handling this, so it won't display
 // the default system "about" dialog after ours is shown.
 e.setHandled(true);
 JOptionPanel.showMessageDialog(null, "About dialog");
 }

 public void handlePreferences(ApplicationEvent e)
 {
 JOptionPanel.showMessageDialog(null, "Preferences dialog");
 }
}
 
Upvote 0

madru

Active Member
Licensed User
Longtime User
OK, here is more on that topic.... not really sure if it works only on AWT/swing


h**p://alvinalexander.com/java/java-mac-osx-about-preferences-quit-application-adapter
 
Upvote 0
Top