Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java-Applet: Dessiner des ovales

Java-Applet: Dessiner des ovales
{filelink=589}

/***** Code de MesExemples.com *******/
import java.applet.Applet;
	import java.awt.Color;
	import java.awt.Graphics;
 
	public class applet extends Applet
		{
 
			public void paint(Graphics g)
				{
 
 
			setBackground(Color.blue);
			setForeground(Color.red);
 
			//Dessiner un ovale simple
			g.drawOval(10,10,50,100);
			// Dessiner un ovale rempli
			g.fillOval(100,20,50,100);
 
				}
	}
 
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>