Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Java can not find source file ..

[es] :: Java :: Java can not find source file ..

[ Pregleda: 1458 | Odgovora: 0 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

materofdeathejo

Član broj: 325817
Poruke: 11
*.telrad.net.



+3 Profil

icon Java can not find source file ..29.10.2014. u 21:19 - pre 115 meseci
Kada kopiram ovaj kod u eclipse i pokrenem ga uvjek dobijem can not locate source file ... Sta treba da uradim ....



Code:
import java.applet.*;
import java.awt.*;

public class Zadatak2 extends Applet
{
int duzina, sirina;
int dx, dy, xp, yp;
int x1, y1, x2, y2;
int click=0;
int brp;

public void init()
{
resize(500, 500);
brp  = Integer.parseInt(getParameter("brp"));
}

public boolean mouseDown(Event e, int x, int y)
{
if (click==0)
{
x1 = x;
y1 = y;
click++;
}else
{
x2 = x;
y2 = y;
repaint();
click=0;
}

return true;
}

public void paint(Graphics g)
{
    dx=Math.abs(x2-x1);
    dy=Math.abs(y2-y1);
    int ax=dx/(brp-1);
    int bx=dx/(brp*2-2);
    int ay=dy/(brp-1);
    int by=dy/(brp*2-2);
    
    if (x2>x1 && y2>y1)
        for (int i=0; i<brp; i++)
            g.drawRect(x1-bx+i*ax, y1-by+i*ay, ax, ay);
    else     if (x2>x1 && y1>y2)
        for (int i=0; i<brp; i++)
            g.drawRect(x1-bx+i*ax, y1-by-i*ay, ax, ay);
    else     if (x1>x2 && y2>y1)
        for (int i=0; i<brp; i++)
            g.drawRect(x1-bx-i*ax, y1-by+i*ay, ax, ay);
    else     
        for (int i=0; i<brp; i++)
            g.drawRect(x1-bx-i*ax, y1-by-i*ay, ax, ay);
    
g.drawLine(x1, y1, x2, y2);
}
}
 
Odgovor na temu

[es] :: Java :: Java can not find source file ..

[ Pregleda: 1458 | Odgovora: 0 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.