CDC Application with Swing
843849Feb 22 2010 — edited Feb 16 2011Hello,
I am working on a CDC application, with Emulator platform - CDC Java(TM) Platform Micro Edition SDK 3.0, Device - SunVgaAGUIPhone1 and Device Profile - PBP-1.1. The following (Hello World app) works fine for me:
import java.awt.*;
public class Main extends Frame {
public Main () {
initComponents();
}
private void initComponents() {
pack();
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Main().setVisible(true);
}
});
}
public void paint(Graphics g) {
g.drawString("Hello, World!", 80, 50);
}
}
My understanding is that CDC with AGUI supports swing. However, when I change the above code to the following, it does not work:
import java.awt.*;
import javax.swing.*;
public class Main extends JFrame {
public Main () {
initComponents();
}
private void initComponents() {
pack();
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Main().setVisible(true);
}
});
}
public void paint(Graphics g) {
g.drawString("Hello, World!", 80, 50);
}
}
Can anyone tell me what am I missing? Or is this even possible?
Thanks!