import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class testing extends Applet implements Runnable
{
/**
*
*/
private static final long serialVersionUID = 6747312521208653906L;
int x =0,width,height;
//Image picture;
Thread t;
AudioClip s1;
MediaTracker mt;
Image car,stop_light,go_light,yellow_light;
Button btnEnter;
Cursor pointer;
public void init()
{
setLayout(new FlowLayout(FlowLayout.CENTER,20,20));
System.out.println("method init():");
width = getSize().width;
height = getSize().height;
// Button btnEnter = new Button("ENTER");
// add(btnEnter);
// btnEnter.addActionListener(this);
// setBackground(Color.BLUE);
}
public void destroy()
{
System.out.println("method start():");
}
public void start()
{
System.out.println("method start():creating thread");
t = new Thread(this);
t.start();
}
public void stop()
{
System.out.println("method stop():");
}
public void run()
{
//mt = new MediaTracker(this);
//pic = getImage(getDocumentBase(),"/family.jpg");
//mt.addImage(pic,1);
/*while(true)
{
System.out.println("method run():awake");
x++;
if(x>3)
x = 0;
showStatus("x is "+x);
System.out.println("method run():requesting repaint");
repaint();
try
{
System.out.println("method run(): sleeping");
t.sleep(500);
}
catch(InterruptedException e){}
}*/
}
public void update(Graphics chest)
{
System.out.println("method update():");
paint(chest);
}
public void paint(Graphics chest)
{
car = createImage(110,400);
Graphics c = car.getGraphics();
c.setColor(Color.black);
c.fillRect(70,420, 150, 50);
chest.drawImage(car,0,0,this);
}
}
i can't see the object i created
java appletjava applet
Page 1 of 1
1 Replies - 1728 Views - Last Post: 13 March 2009 - 08:21 PM
#1
java applet
Posted 13 March 2009 - 04:20 PM
Replies To: java applet
#2
Re: java applet
Posted 13 March 2009 - 08:21 PM
Naming a topic "Java Applet" in a site devoted to Java is not really a good idea and does not give us a clue of what your problem is
Which object you can't see ?
Which object you can't see ?
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|