import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class TreObjekt extends Canvas { private int cirkel_x = 40; private int cirkel_y = 40; private int cirkel_radie = 20; private int triangel_x = 100; private int triangel_y = 40; private int triangel_hojd = 20; private int kvadrat_x = 40; private int kvadrat_y = 100; private int kvadrat_sida = 20; public void paint(Graphics g) { int w = getWidth(); int h = getHeight(); g.setColor(0xff0000); g.fillRect(0, 0, w-1, h-1); g.setColor(0x000000); g.fillArc(cirkel_x - cirkel_radie, cirkel_y - cirkel_radie, 2*cirkel_radie, 2*cirkel_radie, 0, 360); g.fillTriangle(triangel_x, triangel_y, triangel_x + triangel_hojd / 2, triangel_y - triangel_hojd, triangel_x + triangel_hojd, triangel_y); g.fillRect(kvadrat_x, kvadrat_y, kvadrat_sida, kvadrat_sida); } }