 |
 |
BIG newbie question for Java
|
 |
|
 |
|
Mac Enthusiast
Join Date: Jan 2001
Status:
Offline
|
|
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
|
|
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
|
|
thanks 
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Nov 2000
Status:
Offline
|
|
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! 
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Nov 2000
Status:
Offline
|
|
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. 
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |