• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Java, NSApplication, & NSWindow
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Java, NSApplication, & NSWindow


  • Subject: Java, NSApplication, & NSWindow
  • From: Maurice Parker <email@hidden>
  • Date: Mon, 26 Nov 2001 23:21:47 -0600

Hey,

I have a very simple Java program that is doing something that has perplexed
me for about a day and a half. The program creates a NSApplication and then
creates and opens a NSWindow. Everything pretty much works as expected, but
when I close the window, I get a segfault. What I expected to happen, was
to have the application continue to execute, minus the window.

Am I doing something boneheaded or is this a bug? Here is an example of the
behavior:

import com.apple.cocoa.application.*;
import com.apple.cocoa.foundation.*;

public class Test {

public static void main (String [] args) {

NSApplication nsapp = NSApplication.sharedApplication();
NSRect rect = new NSRect(100, 100, 100, 100);
int style = NSWindow.ClosableWindowMask | NSWindow.TitledWindowMask
| NSWindow.ResizableWindowMask|
NSWindow.MiniaturizableWindowMask;;
NSWindow window = new NSWindow(rect, style, NSWindow.Buffered,
false);
window.makeKeyAndOrderFront(window);
nsapp.run();

}

}


Any help is appreciated.

-Maurice


  • Follow-Ups:
    • Re: Java, NSApplication, & NSWindow
      • From: Sam Goldman <email@hidden>
  • Prev by Date: Finding Glyphs for String
  • Next by Date: horizontal tabs in TabView
  • Previous by thread: Re: Finding Glyphs for String
  • Next by thread: Re: Java, NSApplication, & NSWindow
  • Index(es):
    • Date
    • Thread