Beispiel #1
0
  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);
  }
Beispiel #2
0
 public void actualiserProgres(int progres) {
   progressBar.incrementeValue(progres);
 }