예제 #1
0
파일: Vue.java 프로젝트: exidhor/Bejeweled
 public void actualiserTries() {
   int nbTries = model.getTries();
   if (nbTries <= 0) {
     partieEstPerdu(" trie (essai)");
   }
   tries.setText(String.valueOf(nbTries));
 }
예제 #2
0
파일: Vue.java 프로젝트: exidhor/Bejeweled
  public void drawMap() {
    contentPane.removeAll();
    contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
    JPanel ligneIndication = new JPanel();
    ligneIndication.setLayout(new GridLayout(1, 3));
    JPanel caseLevel = new JPanel();
    JLabel texteLevel = new JLabel("Level : ");
    caseLevel.add(texteLevel);
    level = new JLabel(String.valueOf(model.getLevel()));
    caseLevel.add(level);
    ligneIndication.add(caseLevel);

    JPanel caseTries = new JPanel();
    JLabel texteTries = new JLabel("Tries : ");
    caseTries.add(texteTries);
    tries = new JLabel(String.valueOf(model.getTries()));
    caseTries.add(tries);
    ligneIndication.add(caseTries);

    JPanel caseScore = new JPanel();
    JLabel texteScore = new JLabel("Score : ");
    caseScore.add(texteScore);
    score = new JLabel(String.valueOf(model.getScore()));
    caseScore.add(score);
    ligneIndication.add(caseScore);

    contentPane.add(ligneIndication);

    JPanel sousContentPane = new JPanel();
    sousContentPane.setLayout(new GridLayout(8, 8));
    for (int i = 0; i < tableauBijouButton.length; i++) {
      for (int j = 0; j < tableauBijouButton.length; j++) {
        sousContentPane.add(tableauBijouButton[i][j]);
        tableauBijouButton[i][j].setPreferredSize(new Dimension(60, 60));
      }
    }
    contentPane.add(sousContentPane);

    contentPane.add(progressBar.getProgressBar());

    // coloreCoupPossible();
    setContentPane(contentPane);
  }