/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package hello; import javax.microedition.lcdui.*; import java.util.*; /** * * @author turing */ public class AsukohaLouend extends Canvas{ Vector asukohad=new Vector(); public void lisaAsukoht(String asukohatekst){ AsukohaAndmed a=new AsukohaAndmed(asukohatekst); asukohad.addElement(a); repaint(); } protected void paint(Graphics g){ g.setColor(255, 255, 255); g.fillRect(0, 0, getWidth(), getHeight()); g.setColor(0, 0, 0); Enumeration e=asukohad.elements(); while(e.hasMoreElements()){ AsukohaAndmed a=(AsukohaAndmed)e.nextElement(); g.drawString(a.kysiEesnimi(), a.kysiX(), a.kysiY(), Graphics.BOTTOM | Graphics.HCENTER); } System.out.println("joonistati"); } }