Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

briantology

macrumors 6502
Original poster
Jun 5, 2006
289
0
Ok, I've never used Xcode before until now. For school, I've been writing all my programs in vi. Now I need to turn some code into an applet. It's basically a simple game with a GUI front already put on it that I can run from the command line. Now I want to turn that into an Applet. I've been clicking stuff and moving it around in Xcode trying to see some progress, but to no avail. I've also tried using Apple Launcher, but it doesn't do anything for me. So what I need help with is simple: how do I take these 4 .java files and make an applet out of them in Xcode? (or some other IDE recommendation. I've used Eclipse once...) I'm using OS X 10.5.
Thanks for any help!
 

szymczyk

macrumors regular
Mar 5, 2006
187
17
You need to create a Java Applet Xcode project. Choose File > New Project to create a new project. A window with a large list of project types will open. Go to the Java section to see the Java project types. If you're using Xcode 3, select a Java Applet project. I don't have an earlier version of Xcode to verify, but I believe earlier versions of Xcode had AWT and Swing applet projects. You would select the appropriate project, depending on what toolkit you used to create your GUI.

After creating your project, add your .java files to the project by choosing Project > Add to Project.
 

briantology

macrumors 6502
Original poster
Jun 5, 2006
289
0
Ok, yea I think I had gotten that far. Well, as far as making a new Java Applet project and adding my .java files. But now I don't know how to make the file with the main method to run. It keeps running that "hello world" demo applet. Oh, and it's in Swing, which for some reason has trouble loading for me in Safari and Mozilla.
 

briantology

macrumors 6502
Original poster
Jun 5, 2006
289
0
Why does it fill my new project with demo crap? It's kind of annoying. Also, does anyone know why I can't view a Swing based Applet in any of my web browsers?
 

briantology

macrumors 6502
Original poster
Jun 5, 2006
289
0
Ok, so give up on Xcode. I know I need to make the class extend JApplet, and add the init() method, which would "replace" the constructor, but I'm not quite sure what to do with the constructor code and all the JPanel and JFrame variables. Leave them there?
I still don't know why I can't test a Swing applet (simple ones) in a web broswer. I just get the red X.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.