Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Porting Java applet from PC to Mac question

Reply
Thread Tools

Porting Java applet from PC to Mac question

 
 
Michael
Guest
Posts: n/a
 
      02-23-2004
Hello!

I really need your programming help with MRJ. I have a task: to create
an applet which will work on both Mac (it will be great if it could be
run on a 8 or 9) and PC. I am a PC Java developer, so I don't know how
to implement some important things on Mac. I need to extract a PICT
resource #256 from a file and put it in Image class. So, I need a
class like

public class MacPICTImage {
public MacPICTImage {
... check if we execute it on a Mac system, not on a PC ...
}
public static Image get(File imgFile){
...
}
}

I belive that I need some Mac libraries to run a such class and this
libraries is available on a Mac system, but need to compile my applet
on a PC system.

I found some articles in MRJ-Dev list but I completely misunderstood
it.

I'll very appreciate for you help. Thank you.

--
With best regards,
Michael
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      02-23-2004
Michael wrote:
....
> I really need your programming help with MRJ. I have a task: to create
> an applet which will work on both Mac (it will be great if it could be
> run on a 8 or 9) and PC.


I am not too familiar with most of the terms
you are throwing around, but wanted to point
this out. If you can get this to work on a PC,
(read the file) it should work on the Mac for
the same file type.

Can you do it on a PC?

--
Andrew Thompson
* http://www.PhySci.org/ Open-source software suite
* http://www.PhySci.org/codes/ Web & IT Help
* http://www.1point1C.org/ Science & Technology


 
Reply With Quote
 
 
 
 
Matt Parker
Guest
Posts: n/a
 
      02-24-2004
Andrew Thompson wrote:

> Michael wrote:
> ...
>> I really need your programming help with MRJ. I have a task: to create
>> an applet which will work on both Mac (it will be great if it could be
>> run on a 8 or 9) and PC.

>
> I am not too familiar with most of the terms
> you are throwing around, but wanted to point
> this out. If you can get this to work on a PC,
> (read the file) it should work on the Mac for
> the same file type.
>


There are some *really* big gotchas with the MRJ 2.2.x on OS8 & 9. The most
obvious is that you are limited to Java 1.1. Secondly, the VM is written by
Symantec and is buggy as hell (I've even had to write my own HTTP stack in
the past since HttpURLConnection is really broken). You can use Swing, but
it's a really old version that's only available as a separate download, and
suffers from that early version malaise (bugs, slowness etc).

However, with perseverence it is possible... I can attest to that with some
working apps, but with considerably greyer and less hair...

To the OP, I found this code (part of) which seems to convert a PICT to a
java.awt.Image -
http://informagen.com/Java/MacClipbo...oard.java.html

However, it does use some classes called com.apple.mrj which are from the
MRJ itself. Hopefully you can find a file on your Mac called
MRJClasses.zip. If you put this file in your classpath on your Windows box,
you should be able to compile it on Windows and run it on Mac.

Matt

--
Not so interesting...
http://www.mpcontracting.co.uk
 
Reply With Quote
 
Jon A. Cruz
Guest
Posts: n/a
 
      02-25-2004
Michael wrote:
> Hello!
>
> I really need your programming help with MRJ. I have a task: to create
> an applet which will work on both Mac (it will be great if it could be
> run on a 8 or 9) and PC. I am a PC Java developer, so I don't know how
> to implement some important things on Mac. I need to extract a PICT
> resource #256 from a file and put it in Image class. So, I need a
> class like


Why do you need to do that in an Applet? And can you do that with the
current applet?



> I belive that I need some Mac libraries to run a such class and this
> libraries is available on a Mac system, but need to compile my applet
> on a PC system.

You can either

A) Call things via reflection and all will work.

B) Compile against a library that just stubs the calls you want to make.

However, in case B, be sure that you isolate any classes that use Mac
calls so that the classloaders will actuall load your applet on anything
other than a mac.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting 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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
help porting an open source toolkit to Mac and Windows/Cygwin bobicanprogram Python 0 03-22-2011 07:27 PM
Java applet failed when I try to load the avi file in my java applet Krista Java 3 09-15-2004 02:53 AM
wanted($): mac and linux python gui coders for porting Mark Hahn Python 7 09-18-2003 12:13 AM
Re: play wave files using java.applet.Applet webster Java 0 07-20-2003 01:51 PM
Linking problem after porting to Mac OSX (_compress/_uncompress) Daniel Wetzler C++ 0 07-19-2003 04:44 PM



Advertisments