Drawing on a JPanel
问题 I'm start with create RubicPanel class extended from JPanel from NetbeanIDE set it to black background, put it on a JFrame and I start to draw on it by using another class like this. public class Drow { private final int SquareSize = 99; public void DrowRubic(RubicEntity GameRubic, RubicPanel rPanel) { Graphics g = rPanel.getGraphics(); g.setColor(Color.pink); g.fillRect(0, 0, 301, 301); int CurrentFace = GameRubic.getDirection(1); for(int i=0; i<3; i++) { for(int j=0; j<3; j++) { DrowSquare