Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Open Window in Java / Cocoa

Open Window in Java / Cocoa
Thread Tools
Fresh-Faced Recruit
Join Date: Aug 2001
Location: Germany
Status: Offline
Reply With Quote
Feb 23, 2002, 06:31 AM
 
Hello,

my Application has different Windows (e.g. one Mainwindow and one to import Data with a JDBC Source).

I've read that I should create a NIB File for each Window. But I just don't know if this is the right way and how I can call the 2. Window to open using the NIB File.

For Example I habe 2 Dialogs with 2 Controlling-Classes:
MainControl.java : Window Main
ImportControl.java : Window Import.

I know that I should initialize the Window and then call the setFrame method, but how do I link my ImportController to the right Window?

I tried the following Classes but it don't work!
public class ImportController extends NSObject {
NSPanel window; // is linked to the NSPanel
public void show() {
window.setFrame(new NSRect (0,0,500,500), true);
}
}

And the Controller of the Mainwindow calls:
ImportController myImportController = new ImportController();
myImportController.show();


But I always get an java.lang.NullPointerException (in the setFrame Line).

What's wrong?

Thanks in Advance

Mark
     
Fresh-Faced Recruit
Join Date: Aug 2001
Location: Germany
Status: Offline
Reply With Quote
Feb 24, 2002, 08:28 AM
 
I've found a solution, just from opening the ImportDialog from Interface Builder.

And everything works!
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:09 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2