All pastes #737917 Raw Edit

Stuff

public java v1 · immutable
·published 2007-10-15 20:55 UTC
rendered paste body
/*		JFrame winFrame=new JFrame("GameWindow");		this.setSize(WIDTH,HEIGHT);		this.addKeyListener(this);		this.setBackground(Color.BLUE);		this.setIgnoreRepaint(true);		winFrame.getContentPane().add(this);		winFrame.setIgnoreRepaint(true);		winFrame.pack();		winFrame.setVisible(true);		this.createBufferStrategy(2);		bs = this.getBufferStrategy();		this.requestFocus();*/		this.setSize(WIDTH,HEIGHT);		this.addKeyListener(this); //<-- This looks redundant - aren't we already the key listener by default?		this.setBackground(Color.BLUE);		//this.setIgnoreRepaint(true); //<-- If being set on the containing winFrame object below, do we really need to set it interior to this object as well?		this.createBufferStrategy(2);		bs = this.getBufferStrategy();		JFrame winFrame=new JFrame("GameWindow");		winFrame.getContentPane().add(this);		winFrame.setIgnoreRepaint(true);		winFrame.pack(); //<-- Pack seems like a state-specific call, and something you'd probably want closer to the end.  Could setVisable come before this?		winFrame.setVisible(true);		this.requestFocus();