Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8715635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:53:39+00:00 2026-06-13T05:53:39+00:00

If I use com.apple.eawt.Application; even minimally as instantiating it like this: Application app =

  • 0

If I use com.apple.eawt.Application; even minimally as instantiating it like this:

               Application app = Application.getApplication ()

the default Mac application menu misbehaves.

The minimal runnable test code below shows, when it launches, a “Hello World” shell and only the default application menu, labelled ‘SWT’ as expected.

Without an Application, selecting ‘Quit’ (or pressing Command-Q keys) exits the program normally.

With an Application, selecting ‘Quit’ (or pressing Command-Q keys) appears to exit the program normally (for example shell disappears), but the menu labelled ‘SWT’ remains visible. It does not arm, nor is it selectable. According to the IDE (Idea), my test program is still running, and has to be terminated through the IDE.

In my environment, this is 100% reproducible with the test code below.

import com.apple.eawt.Application;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;

public class AboutTester
{

    public static void main ( String[] args )
        {
            Display display = new Display ();
            Shell shell = new Shell ( display );
            shell.setSize ( 300, 200 );
            shell.setLayout ( new FillLayout () );



                            // Comment out the following line - problem goes away.
                Application app = Application.getApplication ();



            Label label = new Label ( shell, SWT.BORDER_SOLID );
            label.setText ( "Hello World" );
            shell.open ();
            while ( !shell.isDisposed () )
                {
                    if ( !display.readAndDispatch () )
                        display.sleep ();
                }
            display.dispose ();
        }
}

Of course, not having access to a com.apple.eawt.Application; is a biggish hindrance on a Mac.

Does anyone know of a solution to this problem?

Full disclosure: What I think may be happening (from other observations) is that Application is generating a menu, which SWT is then covering over with an SWT-generated menu. Attaching an AboutHandler() attaches to the Application-generated menu – and therefore appears to not work when the topmost SWT-generated menu is used. When the SWT-menu quits, it leaves the Application-generated menu behind as an orphan. My test app does not know how to clean this Application-generated menu, and therefore hangs. But that’s speculation.

Mac OS X 10.6.8 (10K549)
org.eclipse.swt.cocoa.macosx.x86_64_3.7.0.v3735b.jar
org.eclipse.swt_3.7.1.v3738a.jar

(Ninja edit for typos)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:53:40+00:00Added an answer on June 13, 2026 at 5:53 am

    I see the exact same issue, I think it may be a threading issue. If you want to have custom menus on mac, then look into using this file which handles that stuff from the Eclipse SWT side https://github.com/ajdaniel/tvrenamer/blob/devel/src/main/com/google/code/tvrenamer/view/CocoaUIEnhancer.java.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For something like this app http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=323242790&mt=8 , what sort of game framework is needed?
I tried to use this code but it doesn't work. http://developer.apple.com/library/ios/#samplecode/PageControl/Introduction/Intro.html Ld /Users/waitonza/Library/Developer/Xcode/DerivedData/Dr_Ngoo-aanknxmuodcgjicaigxevljxokeq/Build/Products/Debug-iphonesimulator/Dr Ngoo.app/Dr
My java / jython app runs a ‘default’ SWT main loop like this: while
I'm trying to use the IKImageViewDemo provided by apple ( http://developer.apple.com/mac/library/samplecode/IKImageViewDemo/index.html ) and I'm
I wish to have a slider similar to they use. http://www.koovs.com/apple-ipod Can anyone suggest
I use sendSynchronousRequest:returningResponse:error method of NSURLConnection class to get NSData from network. http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/Reference/Reference.html NSData
I found this in my travels: http://www.opensource.apple.com/source/IOKitUser/IOKitUser-502/ps.subproj/IOPSKeys.h How would I get the values (as
The Mac App Store guidelines say you can't use private APIs. I'm toying with
I'm trying to use Scripting Bridge in my Mac OS app and am having
Apple.com always display a standard image first and then use javascript to load a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.