hello,
i want porgramming i game with java but i am juste start with java i want to know how can i move the line with keyboard and my code here:
public class Barre extends Frame
{
public void paint(Graphics g)
{
addWindowListener(new FenetreAdaptateur());
g.drawLine(100, 100, 120, 100);
g.setColor(Color.black);
}
//Méthode de l'adaptateur Window
class FenetreAdaptateur extends WindowAdapter
{
public void WindowClosing(WindowEvent event)
{
System.exit(1);
}
}
//point d'entrée de l'interface
public static void main(String arg[])
{
Barre b=new Barre();
b.setSize(200,200);
b.setVisible(true);
}
}
please help me
best
Bookmarks