por que o botão não aparece?
package Principal;
import java.awt.Canvas;
import java.awt.Dimension;
import javax.swing.JButton;
import javax.swing.JFrame;
public class Game extends Canvas implements Runnable {
// Variaveis!
public JFrame frame;
public static final int WIDTH = 400;
public static final int HEIGHT = 300;
// Metodo Construtor!
public Game(){
initFrame();
}
//Metodo Comum!
public void initFrame(){
frame = new JFrame("Game Swing");
frame.add(this);
frame.setPreferredSize(new Dimension(WIDTH,HEIGHT));
frame.pack();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setResizable(false);
frame.setLocationRelativeTo(null);
JButton btnStart = new JButton("OK");
frame.getContentPane().add(btnStart);
frame.setVisible(true);
}
public static void main(String[] args) {
Game game = new Game();
}
@Override
public void run() {
}
}