Mercoledi' 27 Novembre 2002 : 15 8 4 - Anonimo da 193.204.188.254
Applet - Applicazioni
JDK - Java Development Kit Sun
Mercoledi' 27 Novembre 2002 : 15 34 4 - Anonimo da 193.204.188.254
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Mousedemo extends JApplet {
Display disegno;
public void init(){
disegno = new Display();
setContentPane(disegno);
disegno.repaint();
}

class Display extends JPanel {
public void paintComponent(Graphics g){
g.setColor(Color.white);
int width = getSize().width;
int height = getSize().height;
g.fillRect(0,0,width,height);
}
}
Mercoledi' 27 Novembre 2002 : 16 57 3 - Anonimo da 193.204.188.254

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Mousedemo extends JApplet
implements MouseMotionListener,
ActionListener{

Display disegno;
JButton tasto;
boolean tastopremuto = false;


int mousex , mousey;
int x,y;
public void init(){
mousex=0;
mousey=getSize().height - 20;
x = mousex; y=mousey;
disegno = new Display();
setContentPane(disegno);
disegno.add(tasto = new JButton("pigiami!"));
tasto.addActionListener(this);

disegno.addMouseMotionListener(this);
disegno.repaint();
}
public void mouseMoved(MouseEvent e){

}
public void mouseDragged(MouseEvent e){
x = mousex;
y=mousey;
mousex = e.getX();
mousey = e.getY();
disegno.repaint();
}
public void actionPerformed(ActionEvent e){
tastopremuto = true;
disegno.repaint();
}
class Display extends JPanel {
public void paintComponent(Graphics g){

if(tastopremuto){
g.setColor(Color.white);
int width = getSize().width;
int height = getSize().height;
g.fillRect(0,0,width,height);
tastopremuto=false;
}
g.setColor(Color.red);
g.drawLine(x,y,mousex,mousey);
}
}
}

Mercoledi' 27 Novembre 2002 : 20 4 5 - Matteo da ppp-206-166.25-151.libero.it 151.25.166.206
spero di riuscire!
Mercoledi' 27 Novembre 2002 : 20 8 4 - Anonimo da ppp-206-166.25-151.libero.it 151.25.166.206

No comment

Venerdi' 29 Novembre 2002 : 16 0 5 - zito da 193.204.188.254

import java.awt.*;
import javax.swing.*;

public class Tessellazione extends JApplet {
Display disegno;
int xprec,yprec;
public void init(){
disegno = new Display();
setContentPane(disegno);
xprec=0; yprec=0;
}
class Display extends JPanel {
public void paintComponent(Graphics g){
super.paintComponent(g);
hilbert(g,0,0,300,0,0,300,4);
g.setColor(Color.green);
g.fillOval(100,100,200,100);
}
void hilbert(Graphics g,int x0,int y0,int xis, int xjs, int yis,
int yjs,int n){

if(n<=0){g.drawLine(xprec,yprec,
x0+(xis+yis)/2, y0+(xjs+yjs)/2);
xprec=x0+(xis+yis)/2;
yprec=y0+(xjs+yjs)/2;
} else {
hilbert(g,x0, y0, yis/2, yjs/2, xis/2, xjs/2, n-1);
hilbert(g,x0+xis/2, y0+xjs/2 ,xis/2, xjs/2, yis/2, yjs/2, n-1);
hilbert(g,x0+xis/2+yis/2, y0+xjs/2+yjs/2, xis/2, xjs/2, yis/2, yjs/2,n-1);
hilbert(g,x0+xis/2+yis, y0+xjs/2+yjs, -yis/2,-yjs/2, -xis/2, -xjs/2,n-1);

}
}
}
Venerdi' 29 Novembre 2002 : 16 12 3 - x curopenna da labmul3.fisica.uniba.it 193.204.188.60

import java.awt.*;
import javax.swing.*;

public class Tessellazione extends JApplet {
Display disegno;
int xprec,yprec;
public void init(){
disegno = new Display();
setContentPane(disegno);
xprec=0; yprec=0;
}
class Display extends JPanel {
public void paintComponent(Graphics g){
super.paintComponent(g);
hilbert(g,0,0,300,0,0,300,4);
g.setColor(Color.green);

}
void hilbert(Graphics g,int x0,int y0,int xis, int xjs, int yis,
int yjs,int n){

if(n<=0){g.drawLine(xprec,yprec,
x0+(xis+yis)/2, y0+(xjs+yjs)/2);
xprec=x0+(xis+yis)/2;
yprec=y0+(xjs+yjs)/2;
} else {
hilbert(g,x0, y0, yis/2, yjs/2, xis/2, xjs/2, n-1);
hilbert(g,x0+xis/2, y0+xjs/2 ,xis/2, xjs/2, yis/2, yjs/2, n-1);
hilbert(g,x0+xis/2+yis/2, y0+xjs/2+yjs/2, xis/2, xjs/2, yis/2, yjs/2,n-1);
hilbert(g,x0+xis/2+yis, y0+xjs/2+yjs, -yis/2,-yjs/2, -xis/2, -xjs/2,n-1);

}
}
}
}

w la rainone
Venerdi' 29 Novembre 2002 : 16 13 3 - Anonimo da labmul15.fisica.uniba.it 193.204.188.74
public void init(){
disegno = new Display();
setContentPane(disegno);
xprec=0; yprec=0;
}
class Display extends JPanel {
public void paintComponent(Graphics g){
super.paintComponent(g);
hilbert(g,0,0,getSize().width,0,0,getSize().height,4);
}
void hilbert(Graphics g,int x0,int y0,int xis, int xjs, int yis,
int yjs,int n){

if(n<=0){g.setColor(Color.blue);
g.drawLine(xprec,yprec,
x0+(xis+yis)/2, y0+(xjs+yjs)/2);
xprec=x0+(xis+yis)/2;
yprec=y0+(xjs+yjs)/2;
} else {
hilbert(g,x0, y0, yis/2, yjs/2, xis/2, xjs/2, n-1);
hilbert(g,x0+xis/2, y0+xjs/2 ,xis/2, xjs/2, yis/2, yjs/2, n-1);
hilbert(g,x0+xis/2+yis/2, y0+xjs/2+yjs/2, xis/2, xjs/2, yis/2, yjs/2,n-1);
hilbert(g,x0+xis/2+yis, y0+xjs/2+yjs, -yis/2,-yjs/2, -xis/2, -xjs/2,n-1);
}
}
}
}
Venerdi' 29 Novembre 2002 : 16 31 2 - zito da 193.204.188.254

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;

public class Tessellazione extends JApplet {
Display disegno;
int xprec,yprec;
public void init(){
disegno = new Display();
disegno.addMouseListener(disegno);
setContentPane(disegno);
xprec=0; yprec=0;
}
class Display extends JPanel implements MouseListener{
int n=1;
public void mouseClicked(MouseEvent e){
n = n +1;
repaint();
}
public void mouseEntered(MouseEvent e){
}
public void mouseExited(MouseEvent e){
}
public void mousePressed(MouseEvent e){
}
public void mouseReleased(MouseEvent e){
}



public void paintComponent(Graphics g){
super.paintComponent(g);
g.setColor(Color.red);

hilbert(g,0,0,getSize().width,0,0,getSize().width,n);
}
void hilbert(Graphics g,int x0,int y0,int xis, int xjs, int yis,
int yjs,int n){

if(n<=0){g.drawLine(xprec,yprec,
x0+(xis+yis)/2, y0+(xjs+yjs)/2);
xprec=x0+(xis+yis)/2;
yprec=y0+(xjs+yjs)/2;
} else {
hilbert(g,x0, y0, yis/2, yjs/2, xis/2, xjs/2, n-1);
hilbert(g,x0+xis/2, y0+xjs/2 ,xis/2, xjs/2, yis/2, yjs/2, n-1);
hilbert(g,x0+xis/2+yis/2, y0+xjs/2+yjs/2, xis/2, xjs/2, yis/2, yjs/2,n-1);
hilbert(g,x0+xis/2+yis, y0+xjs/2+yjs, -yis/2,-yjs/2, -xis/2, -xjs/2,n-1);

}
}
}
}