Hi,
could anyone help me to figure out why nothing is happen when I'm trying to load a png file in my kindlet. The kindlet is starting, but neither the picture is shown nor an error is saved in the crash log. I don't know why. Could anyone help me please.
Code:
package kindlebeispiel;
import com.amazon.kindle.kindlet.AbstractKindlet;
import com.amazon.kindle.kindlet.KindletContext;
import com.amazon.kindle.kindlet.ui.KImage;
import com.amazon.kindle.kindlet.ui.KTextArea;
import java.awt.Image;
import java.awt.Toolkit;
import java.net.URL;
public class Main extends AbstractKindlet {
private KindletContext ctx;
private Image im;
private KImage card;
public void create(KindletContext context) {
this.ctx = context;
URL urlImage = getClass().getResource("/weather-icons/mix.png");
this.im = Toolkit.getDefaultToolkit().createImage(urlImage);
this.card = new KImage(im);
}
public void start() {
try {
//ctx.getRootContainer().add(new KTextArea("Hello World!"));
ctx.getRootContainer().add(this.card);
} catch (Throwable t) {
t.printStackTrace();
}
}
public void stop() {
}
public void destroy() {
}
}