Ausgabe letzter Züge zu verbessern angefangen
parent
cf4e465b10
commit
6c748bcaa5
|
|
@ -39,8 +39,15 @@ public class ButtonMovePieceListener implements ActionListener {
|
||||||
this.sf.erstelleBrett();
|
this.sf.erstelleBrett();
|
||||||
|
|
||||||
if (game.getLastMove() != null) {
|
if (game.getLastMove() != null) {
|
||||||
char[] z = game.getLastMove().toString().toCharArray();
|
char[] z = game.getLastMove().toString().toCharArray();
|
||||||
String moveString = String.valueOf(z[0]) + String.valueOf(z[1]) + " -> " + String.valueOf(z[2]) + String.valueOf(z[3]);
|
String moveString = "";
|
||||||
|
if(game.getActivePlayer() == 1) {
|
||||||
|
moveString = " " + String.valueOf(z[0]) + String.valueOf(z[1]) + " -> " + String.valueOf(z[2]) + String.valueOf(z[3]);
|
||||||
|
}else if(game.getActivePlayer() == 2){
|
||||||
|
moveString = String.valueOf(z[0]) + String.valueOf(z[1]) + " -> " + String.valueOf(z[2]) + String.valueOf(z[3]+" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
sf.appendText(moveString);
|
sf.appendText(moveString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ import javax.swing.JButton;
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JSplitPane;
|
import javax.swing.JSplitPane;
|
||||||
import javax.swing.JTextArea;
|
import javax.swing.JTextArea;
|
||||||
import javax.swing.JTextField;
|
import javax.swing.JTextField;
|
||||||
|
|
@ -378,7 +379,11 @@ public class SpielFrame extends JFrame {
|
||||||
ausgabe.setForeground(Color.BLACK);
|
ausgabe.setForeground(Color.BLACK);
|
||||||
ausgabe.setText("\n Bisherige Züge:\n");
|
ausgabe.setText("\n Bisherige Züge:\n");
|
||||||
|
|
||||||
statistik.add(ausgabe);
|
JScrollPane scrollPane = new JScrollPane(ausgabe);
|
||||||
|
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
|
||||||
|
|
||||||
|
statistik.add(scrollPane);
|
||||||
|
|
||||||
return statistik;
|
return statistik;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue