Hi all,
running some demos on my kaffe port (kaffe 1.1.6, compiled
for mips machine, using Tiny-X), I testet successfully
some programs using awt, now, I have a demo using swing,
and the program fails as it do not find
javax/swing/JComponent.setDropTarget!
When I run it with:
LD_PRELOAD=/usr/X11R6/lib/libX11.so:/usr/lib/libpng.so:/usr/lib/libz.so:/usr/local/lib/libjpeg.so
kaffe -Dkaffe.awt.nativelib=xawt
-Xbootclasspath/p:/home/AMDgiammy/kaffe-1.1.6/kaffeawt.jar JButtons
I get the following error:
java.lang.NoSuchMethodError:
javax/swing/JComponent.setDropTarget(Ljava/awt/dnd/DropTarget;)V
at javax.swing.JComponent.<init> (JComponent.java:413)
at javax.swing.JRootPane.<init> (JRootPane.java:499)
at javax.swing.JFrame.createRootPane (JFrame.java:214)
at javax.swing.JFrame.getRootPane (JFrame.java:199)
at javax.swing.JFrame.frameInit (JFrame.java:151)
at javax.swing.JFrame.<init> (JFrame.java:113)
at JButtons.<init> (JButtons.java:15)
at JButtons.main (JButtons.java:11)
It seems it do not find swing library: is it correct?
I have looked into rt.jar (compiled on host PC and the copied on
MIPS machine), and I see am entry
-rw-rw-r-- 24643 20-Oct-2005 08:37:38
javax/swing/JComponent.class
so I think the swing library is present.
Do I need to enable some flags when running the demo?
How can I tell where to find the library?
thanks for the help
giammy
Here the example code:
import java.awt.*;
import javax.swing.*;
/** Simple example illustrating the use of JButton, especially
* the new constructors that permit you to add an image.
* 1998-99 Marty Hall, http://www.apl.jhu.edu/~hall/java/
*/
public class JButtons extends JFrame {
public static void main(String[] args) {
new JButtons();
}
public JButtons() {
super("Using JButton");
//WindowUtilities.setNativeLookAndFeel();
//addWindowListener(new ExitListener());
Container content = getContentPane();
content.setBackground(Color.white);
content.setLayout(new FlowLayout());
JButton button1 = new JButton("Java");
content.add(button1);
ImageIcon cup = new ImageIcon("images/cup.gif");
JButton button2 = new JButton(cup);
content.add(button2);
JButton button3 = new JButton("Java", cup);
content.add(button3);
JButton button4 = new JButton("Java", cup);
button4.setHorizontalTextPosition(SwingConstants.LEFT);
content.add(button4);
pack();
//setSize(500, 200);
setVisible(true);
}
}
--
Gianluca Moro http://groups.yahoo.com/group/embeddeditalia/
ISCRIVITI alla Mailing List Italiana su LINUX EMBEDDED
giangiammy@yahoo.com Visit http://ilpinguino.altervista.org/
Roedy Green - 25 Oct 2005 10:50 GMT
On 25 Oct 2005 00:58:38 -0700, "giangiammy@gmail.com"
<giangiammy@gmail.com> wrote, quoted or indirectly quoted someone who
said :
>It seems it do not find swing library: is it correct?
use the code in http://mindprod.com/where.html
to quickly see what classes are present and which jar they are in.
See also http://mindprod.com/jgloss/classpath.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
giangiammy@gmail.com - 25 Oct 2005 11:07 GMT
thank you for the answer,
> use the code in http://mindprod.com/where.html
I'm looking at your site, but the where.html page is not found
thanks
giammy
--
Gianluca Moro http://groups.yahoo.com/group/embeddeditalia/
ISCRIVITI alla Mailing List Italiana su LINUX EMBEDDED
giangiammy@yahoo.com Visit http://ilpinguino.altervista.org/
Roedy Green - 25 Oct 2005 14:39 GMT
On 25 Oct 2005 03:07:41 -0700, "giangiammy@gmail.com"
<giangiammy@gmail.com> wrote, quoted or indirectly quoted someone who
said :
>> use the code in http://mindprod.com/where.html
>
>I'm looking at your site, but the where.html page is not found
Long ago I reorged my site, yet I keep typing the old names. All the
regulars know about my failing and how to compensate. I have redirects
in for some of my most common blunders.
I should have said:
http://mindprod.com/jgloss/where.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
David N. Welton - 25 Oct 2005 13:48 GMT
> Hi all,
>
[quoted text clipped - 3 lines]
> and the program fails as it do not find
> javax/swing/JComponent.setDropTarget!
You might make sure that you have a recent Classpath, as I know that
it's still a work in progress.
> Gianluca Moro http://groups.yahoo.com/group/embeddeditalia/
> ISCRIVITI alla Mailing List Italiana su LINUX EMBEDDED
> giangiammy@yahoo.com Visit http://ilpinguino.altervista.org/
Out of curiousity, what size system are you working with? Perhaps there
are smaller toolkits out there than J2SE...
Saluti,

Signature
David N. Welton
- http://www.dedasys.com/davidw/
Linux, Open Source Consulting
- http://www.dedasys.com/
giangiammy@gmail.com - 26 Oct 2005 07:42 GMT
Hi,
My system has 32M flash + 32M RAM:
if you have a link to other smaller toolkits,
let me know: I will get a try...
thanks
giammy
--
Gianluca Moro http://groups.yahoo.com/group/embeddeditalia/
ISCRIVITI alla Mailing List Italiana su LINUX EMBEDDED
giangia...@yahoo.com Visit http://ilpinguino.altervista.org/
Eric - 27 Oct 2005 21:41 GMT
> Hi,
>
[quoted text clipped - 8 lines]
> ISCRIVITI alla Mailing List Italiana su LINUX EMBEDDED
> giangia...@yahoo.com Visit http://ilpinguino.altervista.org/
Try jamvm, wonka, sablevm...
There's also the Sun CDC reference implementation. I don't know if they
make a JIT downloadable.
All should be quite small. Wonka and the Sun JIT should be quite fast;
jamvm and sablevm are pure interpreters IIRC.
Eric