Czesć mam maly problem bo nie wiem jak uruchomic w prostym programie grafike.
Mam cos takiego i to nie chce dzialac.
Co zrobić??
import java.awt.;
import java.awt.event.;public class kolor implements ActionListener
{
public kolor()
{
Frame f = new Frame();
f.setSize(new Dimension(700, 600));
f.setTitle("GRA WISIELEC");
f.setBackground(Color.blue);
MyListener lst = new MyListener();
f.addWindowListener(lst);
f.setVisible(true);
}public void paint(Graphics g)
{
g.setColor(Color.orange);
g.fillOval(350, 150, 50, 50);
g.fillRect(367,200,15,15);
g.fillRoundRect(350,210, 50, 100, 5, 5);
g.fillRect(350,310,15,50);
g.fillRect(385,310,15,50);
g.fillRect(300,210,50,15);
g.fillRect(400,210,50,15);}
public void actionPerformed(ActionEvent arg0)
{
// TODO Auto-generated method stub
}
public static void main(String args[])
{
kolor k = new kolor();
}
}
class MyWindowAdapter extends WindowAdapter
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
}