Re: [javaCompiler-users] NetBeans and JSwing Layout Support and JMF Support
Status: Beta
Brought to you by:
soapy
From: Marco T. <mt...@gm...> - 2006-09-21 20:47:23
|
Joe Osborne wrote: > Dear Marco >=20 > Your last reply was probably less than an hour. I > greatly appreciate that. You've almost got me > converting to SWT but I would still like to exhaust > the alternatives if at all possible. Actually, you won't do anything else when working on swingWT... But=20 you're welcome to contribute to swingWT! >> swingWT mapps AWT/Swing to SWT. But not everything >> is mapped... >> http://javacompiler.mtsystems.ch/frame_faq.html, >> second question >> >>> So this is where I need help.=20 >>> >>> This is what I am guessing I have to do:=20 >>> 1-Get these classes as java source codes.=20 >>> 2-Get the swingWT as source.=20 >>> 3-Put the classes somewhere in the swingWT >> directory >>> hierarchy. (src folder) >>> 4-Add something to the swingWT main class so they >> are >>> seen.=20 >>> 5-Compile them to a jar.=20 >>> 6-Compile the jar to an object file.=20 >>> 7-Replace the original swingWT object and jar >> files >>> with the ones I modified.=20 >>> >>> Is this what I have to do? >> No. You have to get the swingWT source and add all >> classes/methods you=20 >> still need. Internally you will work with SWT, but >> you simulate the=20 >> AWT/Swing API to outside. >> Change directly to SWT... It's easier... >=20 > I am confused.=20 > You say 'No' but then you seem to imply 'yes' in the > sentence that follows. > Doesn't my (1,2,3)=3D=3DYour"You have to get the swingWT > source and add all classes/methods you still need" > Which ones are right/wrong 1,2,3,4,5,6,7? 1, 3, 4 and maybee 5. An example: You want to do: aJButton.setBackground(Color.RED); But swingWT doesn't have this method. So you download the swingWT=20 source, go to the JButton source file and add the method: public void setBackground(Color c) { privateButton.setBackground(new Color(Display.getCurrent(), c.getRed(),=20 c.getGreen(), c.getBlue()); } While now privateButton is a org.eclipse.swt.widgets.Button and Color is=20 a org.eclipse.swt.graphics.Color. As I said, you fake the AWT/Swing API=20 to the outside and map that internally to SWT. When you have done that, compile swingWT to a jar and overwrite the one=20 from JavaCompiler. > I think the part I need clarification on is the word > "add". > Add the ones that have the "cannot find symbol"? Withhout the example modification I described above, you would get=20 something like "cannot find symbol: swingWT.awt.JButton.setBackground()". > I am not a professional programmer. > I just learned JSwing and NetBeans and have been > programming Java for only 6 months. > Before that I did C and Fortran nearly 20 years ago. > It's taken me 6 months to write only 3500 lines of > code and a lot of that is either IDE auto generated or > templates from Java Almanac. So you can see I am a > beginner. Then this is probably not what you should try to do... Do you really=20 need to compile your program? You might try this as well: http://www.excelsior-usa.com/landing/jet-nc.h= tml > Let me rephrase my understanding of what you are > saying. >=20 > Say the compilation tells me there are "cannot find > symbol" errors for 6 classes that I am using. > I go and get those 6 class files - say from Sun's JDK > or wherever thay are. > I put them in the swingwt-all.jar file which is in the > swingWT-0.87 directory. > Is that right? Where do I put them exactly. > Can you be more specific considering I am relatively > new at this. No, that part of taking existing classes wasn't about AWT or Swing. That=20 was about stuff like sun.audio.AudioConverter and similar that JMF uses=20 but GCJ doesn't (yet) privide. > I had a look at the SwingWT site and I read this: > "Unlike Swing, SwingWT drives native peer widgets for > your platform from SWT" - Ich verstehe dieses ganz > weniger als ich Chinesen verstehe.=20 Chinese is funny: Nin hao ma? Wo shi ruishi ren! Wo jiao Marco. I learned a little chinese at the university :-) But back to the point: If you don't understand that, you shouldn't do=20 what you're doing right now... Use SWT directly or don't compile your=20 program to native. > You have said it's easier to convert my program to > SWT. At the rate I go that may take months. Ich bin so > langsam wie eine Schildkr=F6te, die in Schnapps > schwimmt. Debugging is a killer. If all I have to do > is get some class files, put them in the right place > and that's it then that seems a lot faster in concept. No, you have to do a lot more and need deep AWT/Swing&SWT knowledge to=20 get swingWT working for your needs. > Ah please don't write instructions back to me in > German. I haven't used that language in 20 years > either. Your English is so good, even when I saw your > spelling of "sure" I didn't realize your first > language was not English. Stupid spelling mistakes. I really should install a english spell=20 checker. Hey, wait a minute. There's a button in the toolbar where I can=20 switch between english and german! Great... > I thought it was new slang. > I teach English to Koreans here. They find it so > difficult to learn. That's what my program is for, > learning English for Koreans. Doesn't sound like you need to compile it to native if you ask me... > Have you heard of Excelsior Jet? Yes ;-) > Jet and your program > are the only two in the whole world that compile java > to exe for Windows. Actually, Excelsior Jet and GCJ. I just put GCJ together into a user=20 friendly form. > These are the prices for Jet: >=20 > Enterprise $4,500 =20 > Professional $2,300 =20 > Standard $1,200=20 > > Pretty expensive isn't it? Yes. Think I could ask for 100$ for JavaCompiler and still be good of... Marco |