Fusion Info Soft - Website and Mobile Application Development
basic game in java


package basicgame;

import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
import java.util.Random;

public class Gamev1 extends JPanel implements Runnable
Random randomGenerator = new Random();
Thread mainthrd;
boolean running=true;
int width=400,height=400;
int MAX=1;
int currX[]=new int[MAX];
int currY[]=new int[MAX];

    mainthrd=new Thread(this);
    }catch(Exception e){        System.out.println(e);System.exit(0);}

public void paintComponent(Graphics g)
    Graphics2D g2d=(Graphics2D)g;
public void run()

public static void main(String []args)
    JFrame window=new JFrame();
    window.setTitle("Basic Game v1");
    window.getContentPane().add(new Gamev1());

share on whatapp

Comments do you means by jframe in java?
Private Policy   Terms of Service   8800