Help - Search - Members - Calendar
Full Version: Swing on SL-6000
OESF Forums > Distros, Development, and Model Specific Forums > Everything Development > Personal Java/Jeode/J2ME Personal Profile
deepster
New to the Zaurus and a little to Java, but trying to get a version of Swing working on my 6000. Downloaded swingZ.jar from http://jeffreyrfox.addr.com/zaurus/ and tried to run the sample, but it still could not find swing ( NoClassDefFoundError ). Sounds like a classpath problem, but I believe that I have the simplest config with swingZ.jar and SimpleExample.jar in the same directory and running it with "evm -cp ./swingZ.jar:SimpleClass.jar SimpleClass"

Anyone else got this working on the 6000 or have a better alternative to Swing on Zaurus for the easy creation of dialog windows?

Thanks,
-- Brian
Omicron
QUOTE(deepster @ Oct 14 2004, 04:18 PM)
New to the Zaurus and a little to Java, but trying to get a version of Swing working on my 6000. Downloaded swingZ.jar from http://jeffreyrfox.addr.com/zaurus/ and tried to run the sample, but it still could not find swing ( NoClassDefFoundError ). Sounds like a classpath problem, but I believe that I have the simplest config with swingZ.jar and SimpleExample.jar in the same directory and running it with "evm -cp ./swingZ.jar:SimpleClass.jar SimpleClass"

Anyone else got this working on the 6000 or have a better alternative to Swing on Zaurus for the easy creation of dialog windows?

Thanks,
-- Brian



Shouldn't that be ? :

"evm -cp ./swingZ.jar:./SimpleClass.jar SimpleClass"
freizugheit
Give EWE VM at http://www.ewesoft.com/M2.htm a try.
deepster
Omicron - Guess that depends on what your environment settings are. I am set to serach the present working directory, so ./SimpleExample.jar = SimpleExample.jar

freizugheit - Thanks, will give that a look.

Anyone else get Swing working on th 6000?
deepster
Well, my problem was (of course) a dumb path problem. But, once I solved that, I ran into an error

java.lang.NoSuchMethodError:
java/awt/Component.getPeer()Ljava/awt/peer/ComponentPeer;

See http://groups.google.com/groups?hl=en&lr=&....com%26rnum%3D1

if you run into this.

Thanks,
-- Brian
smuelas
I have swing running (compiling and running) with no problems on my 6000.
If anyone needs help, I will be delighted to help.
Santiago Muelas (smuelas@telefonica.net)
AsLan^
QUOTE(smuelas @ Oct 24 2004, 08:03 AM)
I have swing running (compiling and running) with no problems on my 6000.
If anyone needs help, I will be delighted to help.
Santiago Muelas    (smuelas@telefonica.net)
*


Hi smuelas, I can compile a swing application using jikes and swingZ.jar from http://foxfrenchtranslations.com however I cannot get it to run with the stock jeode (evm) on my 6000. I get the same error as the others but I didnt see anything helpful in the link posted by deepster. Any help would be welcome.

Thank you
smuelas
Hi Aslan,
The only thing that I can tell you is that I've never been able to run satisfactorily "jikes" in my Zaurus. It gives always mistakes with calculations a.s.o. What I do is what follows:
1- I have the "classes.zip" from blackdown's java 1.1.8 and the swingZ.jar in my card.
2- I compile with: evm -cp /mnt/cf/classes.zip:/mnt/cf/swingZ.jar:. sun.tools.javac.Main Myprogram.java
3- I run the compiled program with: evm -cp /mnt/cf/classes.zip:/mnt/cf/swingZ.jar:. Myprogram

Doing that, I've been able to run quiet big Finite Element programs using swing-sliders and all type of buttons, borders, a.s.o.

The other "nice" point about that is that running Debian with Xqt, I have jdk1.1.8 installed. When in Debian, I run the application with: java -classpath /swingZ.jar:. My program
and when in Qtopia as I'have said at the beginning. Compiling from Debian or from Qtopia works o.k. for the other one.

If you have any more problem, please contact me. Good luck
Smuelas
AsLan^
Hi smuelas, I tried a couple of different classes.zip from the blackdown java 1.1.8 jdk, specifically i386 v3, arm v1, and arm v2 and I got the same error each time while trying to compile...

java.lang.NoSuchMethodError: java.lang.Character: method isJavaLetterOrDigit┬ęZ not found

followed by at sun.tools.blah for about ten lines.

Any ideas ? is there a specific version of classes.zip that I should be using ?

Thanks for your help smile.gif

oh and the program I am trying to compile is very simple... its from a java textbook.

import javax.swing.*;

/**
A simple demo of a window with swing
*/

public class FirstSwingDemo
{
public static final int WIDTH = 300;

public static final int HEIGHT = 200;

public static void main(String[] args)
{
JFrame myWindow = new JFrame();
myWindow.setSize(WIDTH, HEIGHT);

JLabel myLabel = new JLabel("Please dont click that button");

myWindow.getContentPane().add(myLabel);

WindowDestroyer myListener = new WindowDestroyer();
myWindow.addWindowListener(myListener);

myWindow.setVisible(true);

}

}
smuelas
Hi Aslan,
I've tried your class and it works o.k. in the Zaurus. BUT, I've removed the lines:

WindowDestroyer myListener = new WindowDestroyer();
myWindow.addWindowListener(myListener);

as I've never heard about a class called "WindowDestroyer".
If you want to "destroy" your class when closing the window, just add instead of this 2 lines, what follows:

addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0); }
});

Anyway, the class runs with no problems. If you are unable to run it, tell me and I will put my "classes.zip" and "swingZ.jar" somewhere for you to download it. O.K.? :-)

Smuelas
AsLan^
Hi smuelas,

well I tried removing the WindowDestroyer lines but no dice, I still get the same error. Could you please post your classes.zip and swingZ.jar I would be most grateful.

Also, thanks for the code tidbit smile.gif
smuelas
Hi Asland, I have put "classes.zip" and "swingZ.jar", both of them in a new compressed package with the name "myjava.zip", in my Debian-Xqt page at
http://w3.mecanica.upm.es/~smuelas/debianxqt.html
Try it.
Regards
Smuelas
AsLan^
Thank you for taking the time to post that, unfortunately I still get the same error !

Perhaps its my JVM... evm -showversion displays

java version "J2ME Personal Profile for Zaurus 1.0"
J2ME Personal Profile 1.0 (build 1.0_fcs-b25)
J2ME CDC-HI 1.0_v01

Is this the same as yours ?
smuelas
Well, don't mind. If you have just said this at the beginning :-(
What you have is the "personal profile" from Sun. This is a more limited Java than Jeode, and you can't run Swing (to my knowledge) with it.
You should have to uninstall j2me but, perhaps, this is a little bit too complicated for you as it is included with the rom for Z-6000.Instead, try to
get Jeode and install it. A small problem could be that the JVM that you have runs with the instruction "cvm" but there is a link from "cvm" to "evm". If everything goes o.k. you will have cvm in /home/QtPalmtop/j2me/bin/cvm (with a possible link to evm). The "true" evm (the one from Jeode) will be in /home/QtPalmtop/bin/evm.
To use this one it can be convenient to create an alias in your " .bashrc " file in the /home/zaurus directory. You can write a line with:
alias evm='/home/QtPalmtop/bin/evm -cp /path to/myjava.zip:.'
in such a way that you don't have to care anymore about "classes.zip" and/or "swingZ.jar". To compile it should be enough to write:
evm sun.tools.javac.Main Yourprogram.java
And to run it: evm Yourprogram
Perhaps I've said something wrong, but I cannot test it now as I'm not at home.
Just, try it and tell me the result. :-)
And be optimistic: finally, you will run some swing classes. For sure
Smuelas
AsLan^
smuelas, you sir, are the man !

it all works now ! I cant believe I never noticed that jeode and personal java were two seperate programs !

Thank you for all your help,

AsLan^ smile.gif
smuelas
Hi Aslan, I'm very happy that everything went so quick and so well for you. Congratulations!! (Now you have a long way to walk with Java and Swing... :-)
I want to mention that I didn't meant to say that Jeode is better or worse than j2me. (In my opinion, jeode is much better, but it is a very humble opinion). The problem for Zauruses is that J2me is based on java2, so from java1.2 on, and it is very constrained in possibilities. On the contrary, Jeode is an optimization of java1.1.8 for Zaurus. It runs quicker, at least in graphics, and is better integrated with QT. Anyway, the BIG problem for j2me is that, to my knowledge, there is only one "swing" available for Zaurus: the "famous" swingZ.jar, based on the swing added to the jdk1.1.8 at the last moment. This swing doesn't run on Java2 software. It needs to use the last versions of java1.
Good luck with Java. I'm keen to it and if you need some help, you know how to contact me (although I don't look so much this site lately...)
Santiago Muelas
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.