MuestraRastreo.java
Categorías: CategoryJava | CategoryProgramacion |
1 import javax.swing.*;
2 import java.awt.*;
3
4 public class MuestraRastreo extends JFrame{
5 public MuestraRastreo(){
6 super("Muestra de Linea de Rastreo");
7 JPanel p = new JPanel(){
8 public void paint(Graphics g){
9 int y,j;
10 g.setColor(Color.yellow);
11 for(y = 50; y <= 110; y=y+5){
12 g.drawLine(25,y, 300, y);
13 }
14 g.setColor(Color.blue);
15 for(y = 110; y <= 170 ; y=y+5){
16 g.drawLine(25,y, 300, y);
17 }
18 g.setColor(Color.red);
19 for(y = 170; y <= 220; y=y+5){
20 g.drawLine(25,y, 300, y);
21 }
22 g.setColor( Color.white );
23 }
24 };
25 getContentPane().add(p);
26 setLocation(0, 0);
27 setSize(1000,1000);
28 setVisible(true);
29 }
30
31 public static void main(String[] arg){
32 new MuestraRastreo();
33 }
34 public void update(){
35 repaint();
36 }
37 }
