/***** Code de MesExemples.com *******/ import java.awt.*; import java.applet.*; public class applet extends Applet { public void paint(Graphics g) { Font f = new Font("Helvetica", Font.BOLD,20); g.setFont(f); g.drawString("Continuer à sourir!!!", 50, 30); g.drawOval(60, 60, 200, 200); g.fillOval(90, 120, 50, 20); g.fillOval(190, 120, 50, 20); g.drawLine(165, 125, 165, 175); g.drawArc(110, 130, 95, 95, 0, -180); } } Code HTML d'exécution de l'applet <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//FR"> <html> <head> </head> <body bgcolor="000000"> <center> <applet code = "applet.class" width = "500" height = "300" > <param name = "Image" value = "image.gif"> </applet> </center> </body> </html> |
Cet article Java-Applet: Dessiner un Smiley est apparu en premier sur .