[kaffe] kaffe and javax
Gianluca Moro
giangiammy at yahoo.com
Tue Oct 25 00:39:36 PDT 2005
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 at yahoo.com Visit http://ilpinguino.altervista.org/
___________________________________
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB
http://mail.yahoo.it
More information about the kaffe
mailing list