![]() Código do Exemplopublic class ImageView extends java.applet.Applet {Image baseImage; public void init() { baseImage = getImage(getDocumentBase(), getParameter("img")); } public int f(int x) { return 2*x/3; } public void paint(Graphics g) { for (int x = 0 ; x < getSize().width ; x++) { g.drawLine(x, f(x), x + 1, f(x + 1)); } g.drawImage(baseImage, 30, 100, this); g.drawString("Vejam as funcoes?", (int)getSize().width/2, (int)getSize().height/3); } public String getAppletInfo() { return "Texto, figura e ligando os pontos."; } } Download do código - AppletExemplo.java Download da figura - fig.gif ![]() O Applet![]() |