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 > BIG newbie question for Java

BIG newbie question for Java
Thread Tools
Mac Enthusiast
Join Date: Jan 2001
Status: Offline
Reply With Quote
Jan 30, 2001, 12:04 PM
 
ok, here is the deal,
im good at writing Java applets and I am wondering how i can port them to an native app in OSX. All i want is a window that i can draw my applet in. Is it possible? Can i use the same drawing functions that i use in my applet?

If it is possible, could somebody please tell me how i would go about doing it?

Thank you very much,
Loren
     
Forum Regular
Join Date: Oct 2000
Location: Portland, OR USA
Status: Offline
Reply With Quote
Jan 30, 2001, 12:54 PM
 
All you need to do is write a main method that creates a Frame, adds the Applet to it, and runs the Applet. This ends up with an application/applet, one important things is to initialize any params your applet might be expecting, but the following show the general idea.

MyApplet extends Applet {
...
public static void main(String[] args) {
Frame f = new Frame("MyApplication");
Applet myApplet = new MyApplet();
f.add(myApplet);
f.show();
myApplet.init();
myApplet.start();
}
}
     
Mac Enthusiast
Join Date: Jan 2001
Status: Offline
Reply With Quote
Jan 30, 2001, 06:31 PM
 
thanks
     
Senior User
Join Date: Nov 2000
Status: Offline
Reply With Quote
Jan 30, 2001, 09:13 PM
 
As an aside(that you may already know)...

You can use Project Builder to make it double-clickable as well. I can't remember off hand how to include a .jar(or separate .class files) in Project Builder but somewhere around here I think someone asked that very question.

hope it helps!
     
KewlMOTD
Guest
Status:
Reply With Quote
Jan 31, 2001, 09:05 AM
 
Use MRJAppBuilder
     
Senior User
Join Date: Nov 2000
Status: Offline
Reply With Quote
Jan 31, 2001, 11:03 AM
 
I would've said MRJAppBuilder but I think it's harder to use.

I did alot of Java stuff on OS9 and was delighted that MRJAppBuilder made it through into OSX but it wasn't the same. I attempted to use it a couple of times and gave up with nothing to show for my time. ProjectBuilder makes it pretty simple so I saw no need to use(read: learn to use) MRJAppBuilder. Also, for other(Cocoa, Carbon, etc.) development you'll probably end up using ProjectBuilder anyway.

I suppose that's just my 2¢ though.
     
   
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:14 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