Author Topic: Swing on SL-6000  (Read 7396 times)

deepster

  • Newbie
  • *
  • Posts: 9
    • View Profile
Swing on SL-6000
« on: October 14, 2004, 05:18:21 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

Omicron

  • Hero Member
  • *****
  • Posts: 608
    • View Profile
    • http://
Swing on SL-6000
« Reply #1 on: October 14, 2004, 06:28:55 pm »
Quote
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:./[/u]SimpleClass.jar SimpleClass"
"You Shall Not Pass"    
....Gandalf, Lord Of The Rings
--------------------------------------------------------------
C-860 (Cacko), 3x4gb MD  
DLINK 660W, 1GB SD,  
Upgraded Archos AV320 w/80GB HDD
Pocketop and Targus IR keyboards
Favorite Deal Site: SaveCity.net (pretty cool, good deals daily on one page)

freizugheit

  • Sr. Member
  • ****
  • Posts: 409
    • View Profile
    • http://
Swing on SL-6000
« Reply #2 on: October 15, 2004, 03:05:17 am »
Give EWE VM at http://www.ewesoft.com/M2.htm  a try.

deepster

  • Newbie
  • *
  • Posts: 9
    • View Profile
Swing on SL-6000
« Reply #3 on: October 15, 2004, 08:06:59 am »
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

  • Newbie
  • *
  • Posts: 9
    • View Profile
Swing on SL-6000
« Reply #4 on: October 15, 2004, 08:57:32 am »
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

  • Full Member
  • ***
  • Posts: 110
    • View Profile
Swing on SL-6000
« Reply #5 on: October 24, 2004, 12:03:58 pm »
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)
Zaurus SL-6000  --  Microdrive Hitachi 6Gb placed permanently on CF slot.

AsLan^

  • Newbie
  • *
  • Posts: 45
    • View Profile
    • http://
Swing on SL-6000
« Reply #6 on: May 21, 2005, 12:20:37 am »
Quote
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)
[div align=\"right\"][{POST_SNAPBACK}][/a][/div]

Hi smuelas, I can compile a swing application using jikes and swingZ.jar from [a href=\"http://foxfrenchtranslations.com]http://foxfrenchtranslations.com[/url] 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
doublethink.

smuelas

  • Full Member
  • ***
  • Posts: 110
    • View Profile
Swing on SL-6000
« Reply #7 on: May 22, 2005, 07:05:46 am »
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
Zaurus SL-6000  --  Microdrive Hitachi 6Gb placed permanently on CF slot.

AsLan^

  • Newbie
  • *
  • Posts: 45
    • View Profile
    • http://
Swing on SL-6000
« Reply #8 on: May 23, 2005, 08:53:34 am »
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

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);
      
   }
   
}
« Last Edit: May 23, 2005, 08:54:49 am by AsLan^ »
doublethink.

smuelas

  • Full Member
  • ***
  • Posts: 110
    • View Profile
Swing on SL-6000
« Reply #9 on: May 25, 2005, 06:09:30 pm »
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
Zaurus SL-6000  --  Microdrive Hitachi 6Gb placed permanently on CF slot.

AsLan^

  • Newbie
  • *
  • Posts: 45
    • View Profile
    • http://
Swing on SL-6000
« Reply #10 on: May 26, 2005, 10:43:06 pm »
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
doublethink.

smuelas

  • Full Member
  • ***
  • Posts: 110
    • View Profile
Swing on SL-6000
« Reply #11 on: May 30, 2005, 02:18:15 am »
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
Zaurus SL-6000  --  Microdrive Hitachi 6Gb placed permanently on CF slot.

AsLan^

  • Newbie
  • *
  • Posts: 45
    • View Profile
    • http://
Swing on SL-6000
« Reply #12 on: May 30, 2005, 06:16:13 am »
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 ?
doublethink.

smuelas

  • Full Member
  • ***
  • Posts: 110
    • View Profile
Swing on SL-6000
« Reply #13 on: May 30, 2005, 09:19:43 am »
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
Zaurus SL-6000  --  Microdrive Hitachi 6Gb placed permanently on CF slot.

AsLan^

  • Newbie
  • *
  • Posts: 45
    • View Profile
    • http://
Swing on SL-6000
« Reply #14 on: May 30, 2005, 07:13:50 pm »
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^
doublethink.