Menu Bar under Mac OS

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Menu Bar under Mac OS

Phase GmbH
Hi,

this is most likely a Java question. I programmed a small IJ plugin by extending the PlugInFrame class. The plugin frame has a menu  bar. This is working fine under Windows and Linux but under Mac OS the menu bar of the plugin frame is not visible. What has to be done to get the menu bar  visible in the plugin frame?

Regards

Christian Kreutzfeldt
Reply | Threaded
Open this post in threaded view
|

Re: Menu Bar under Mac OS

Michael Schmid
Hi Christian,

yes, a nasty problem - my usual workaround is using buttons at the  
top of the frame, each with a popup menu that comes up.

myMenuButton.addActionListener(this);
public void actionPerformed ...
     if (source == myMenuButton) {
          myPopupMenu.show(myMenuButton, 1, 1);;

A disadvantage of this method - the user interface is bit unusual:
A true menu pops up as soon as you press the mouse button. In my  
solution with the buttons, the menu pops up after one releases the  
mouse button (my attempts to fix this or work around it all failed).

Michael
________________________________________________________________

On 11 Feb 2009, at 10:35, Phase GmbH wrote:

> Hi,
>
> this is most likely a Java question. I programmed a small IJ plugin  
> by extending the PlugInFrame class. The plugin frame has a menu  
> bar. This is working fine under Windows and Linux but under Mac OS  
> the menu bar of the plugin frame is not visible. What has to be  
> done to get the menu bar  visible in the plugin frame?
>
> Regards
>
> Christian Kreutzfeldt
Reply | Threaded
Open this post in threaded view
|

Re: Menu Bar under Mac OS

manuelbarzi
hi, Christian,

following the workaround of Micheal, you can also add a snippet to
detect the operating system, and then providing one solution or other
depending on that.

String lcOSName = System.getProperty("os.name").toLowerCase();
boolean MAC_OS_X = lcOSName.startsWith("mac os x");
if (MAC_OS_X) {
...
} else {
...
}

greetings.

On Wed, Feb 11, 2009 at 11:49 AM, Michael Schmid
<[hidden email]> wrote:

> Hi Christian,
>
> yes, a nasty problem - my usual workaround is using buttons at the top of
> the frame, each with a popup menu that comes up.
>
> myMenuButton.addActionListener(this);
> public void actionPerformed ...
>    if (source == myMenuButton) {
>         myPopupMenu.show(myMenuButton, 1, 1);;
>
> A disadvantage of this method - the user interface is bit unusual:
> A true menu pops up as soon as you press the mouse button. In my solution
> with the buttons, the menu pops up after one releases the mouse button (my
> attempts to fix this or work around it all failed).
>
> Michael
> ________________________________________________________________
>
> On 11 Feb 2009, at 10:35, Phase GmbH wrote:
>
>> Hi,
>>
>> this is most likely a Java question. I programmed a small IJ plugin by
>> extending the PlugInFrame class. The plugin frame has a menu  bar. This is
>> working fine under Windows and Linux but under Mac OS the menu bar of the
>> plugin frame is not visible. What has to be done to get the menu bar
>>  visible in the plugin frame?
>>
>> Regards
>>
>> Christian Kreutzfeldt
>