Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class RubikView extends javax.swing.JFrame {
- Rubik model;
- RubikController controller;
- /** Creates new form RubicView */
- public RubikView() {
- model = new Rubik();
- controller = new RubikController();
- controller.setModel(model);
- controller.setView(this);
- initComponents();
- updateView();
- }
- public void updateView() {
- // กำลังจะขึ้นส่วนการ update หลังจากที่เกิน event
- this.pnlColor1.setBackground(controller.getColor(0, 0, 1));
- this.pnlColor2.setBackground(controller.getColor(0, 1, 1));
- this.pnlColor3.setBackground(controller.getColor(0, 2, 1));
- this.pnlColor4.setBackground(controller.getColor(1, 0, 1));
- this.pnlColor5.setBackground(controller.getColor(1, 1, 1));
- this.pnlColor6.setBackground(controller.getColor(1, 2, 1));
- this.pnlColor7.setBackground(controller.getColor(2, 0, 1));
- this.pnlColor8.setBackground(controller.getColor(2, 1, 1));
- this.pnlColor9.setBackground(controller.getColor(2, 2, 1));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement