Prima Applet Java
import java.awt.*;
import java.applet.*;
public class PrimaApplet extends Applet {
public void paint(Graphics g){
g.drawString("Benvenuti gli studenti della classe IV",20,30);
}
}
Seconda Applet Java
import java.awt.*;
import java.applet.*;
public class SecondaApplet extends Applet {
public void paint(Graphics g){
Graphics2D g2d= (Graphics2D) g;
Rectangle r=new Rectangle(10,10,50,20);
g2d.draw(r);
}
}
Terza Applet Java
import java.awt.*;
import java.applet.*;
import java.util.*;
public class TerzaApplet extends Applet {
private Shape shape;
public void init(){
shape= new Rectangle2D.Double(-1.0,-1.0,1.0,1.0);
}
public void paint(Graphics g){
Graphics2D g2d= (Graphics2D) g;
g2d.setColor(Color.BLACK);
int width=getSize().width;
int height=getSize().height;
g2d.fillRect(0,0,width,height);
Rectangle r=new Rectangle(10,10,50,20);
g2d.draw(r);
}
}
Applet 1
< html >
< head >< title >prima applet< /title >< /head >
< body >
< applet codebase="." code="PrimaApplet.class" name="Prima Applet" width="300" height="500" >< /applet >
< /body >
< /html >
Applet 2
< html >
< head >< title >prima applet< /title >< /head >
< body >
< applet codebase="." code="SecondaApplet.class" name="Seconda Applet" width="300" height="500" >< /applet >
< /body >
< /html >
Venerdì sicuramente finiremo di fare il tutto ;)
Buona Serata!
Buona Serata!
1 commento:
Speriamo di completare. Ti ringrazio.
Posta un commento