うまくいかないペイントコンポーネントの助けが必要です。助けてください:( ps:すべてのインポートがあります...
public JavaGame() {
setVisible(true);
setSize(500, 500);
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setResizable(false);
setLocationRelativeTo(null);
setTitle("Java Game");
}
public void paintComponent (Graphics g)
{
super.paintComponents(g);
g.drawString("Hello World!", 20, 20);
}
public static void main(String[] args) {
new JavaGame();
}