import java.awt.Color;import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;public class TetrisFrame extends JFrame {
private static final int GAME_WIDTH = 500;
private static final int GAME_HIGHT = 550;
private int x = 60;
private int y = 100;

JPanel jpL = new JPanel();
JPanel jpR = new JPanel();
JButton reStart = new JButton("重置");
JButton over = new JButton("结束");

JLabel score = new JLabel();
JLabel speed = new JLabel();
JLabel author = new JLabel();

public TetrisFrame() {
this.setTitle("简易俄罗斯方块进行中……");
this.setLayout(null);
this.setBounds(x,y,GAME_WIDTH,GAME_HIGHT);
this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);

jpL.setBackground(Color.BLUE);
jpL.setBounds(0, 0, GAME_WIDTH*3/5, GAME_HIGHT);
jpR.setBackground(Color.green);
jpR.setBounds(3*GAME_WIDTH/5, 0, 2*GAME_WIDTH/5, GAME_HIGHT);
jpR.setLayout(null);

reStart.setBounds(jpR.getWidth()/5, jpR.getHeight()/10, 40, 20);
over.setBounds(3*jpR.getWidth()/5, jpR.getHeight()/10, 40, 20);
score.setText("分数:");
speed.setText("速度:");
author.setText("玩家制作,玩得尽兴!");
score.setBounds(3*jpR.getWidth()/10,2*jpR.getHeight()/5,60,20);
speed.setBounds(3*jpR.getWidth()/10,2*jpR.getHeight()/5+60,60,20);
author.setBounds(1*jpR.getWidth()/5,4*jpR.getHeight()/5,150,20);
jpR.add(reStart);
jpR.add(over);
jpR.add(score);
jpR.add(speed);
jpR.add(author);
this.add(jpL);
this.add(jpR);
this.setVisible(true);
}

public static void main(String[] args ) {
new TetrisFrame();
}

}
这里面 加入 paint 方法 后 就 没有 JPanel 了? 初学者 问题愚蠢 请见谅