double buffering in java 2011-12View more random threads:
- What about Microsoft vs Java in 2011-2012
- KeyPress Event Handlers in java
- doubt about "this" object in java 2011
- Java is a beautiful language, but on web there are few web...
- NetBeans IDE 7.0 Download Started in 2011 for beginners
- what are the latest updates for Java May 2011
- Error 1721: There is a problem with this Windows Installer...
- JAVA Error 1723. There is a problem with this Windows...
- Java Applet Won't Load In Browser 2011 Java
- string java is case senstive error
i write the code of double buffering in java this is write code
Sponsored Links
Code:public Game(){ super("test"); setSize(495,429); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setVisible(true); try{ img = ImageIO.read(new File("background.png")); } catch (IOException e){ } start1 = new MovePlayer(); start2 = new MoveEnemy(); start2.start(); start1.start(); addKeyListener(new ButtonListener1()); }//close constructor public void paint(Graphics g){ super.paint(g); g.setColor(Color.RED); g.fillRect(player.x,player.y,player.width,player.height);//player g.setColor(Color.BLACK); g.fillRect(enemy.x,enemy.y,enemy.width,enemy.height);//enemy g.drawImage(img, 0 - focusX, 0 - focusY, this);//background image }//close paint
There are currently 1 users browsing this thread. (0 members and 1 guests)