Better looking flipButton
parent
11cede7678
commit
5ae9aef605
|
|
@ -105,13 +105,12 @@ public class GameGui {
|
||||||
board.fill = GridBagConstraints.BOTH;
|
board.fill = GridBagConstraints.BOTH;
|
||||||
chessPanel.add(panel);
|
chessPanel.add(panel);
|
||||||
// Button unten rechts
|
// Button unten rechts
|
||||||
flipBoardButton = new JButton("\u21bb"); // 🔄
|
flipBoardButton = new JButton("⇵");
|
||||||
flipBoardButton.setPreferredSize(new Dimension(50, 50));
|
flipBoardButton.setPreferredSize(new Dimension(70, 70));
|
||||||
flipBoardButton.setBackground(new Color(0x778da9));
|
flipBoardButton.setFont(new Font("SansSerif", Font.BOLD, 40));
|
||||||
|
flipBoardButton.setBackground(new Color(0x5500ff));
|
||||||
flipBoardButton.setForeground(Color.WHITE);
|
flipBoardButton.setForeground(Color.WHITE);
|
||||||
flipBoardButton.setFocusPainted(false);
|
flipBoardButton.setFocusPainted(false);
|
||||||
flipBoardButton.setFont(new Font("Serif", Font.BOLD, 25));
|
|
||||||
flipBoardButton.setToolTipText("Brett drehen");
|
|
||||||
|
|
||||||
GridBagConstraints btn = new GridBagConstraints();
|
GridBagConstraints btn = new GridBagConstraints();
|
||||||
btn.gridx = 0;
|
btn.gridx = 0;
|
||||||
|
|
@ -119,7 +118,7 @@ public class GameGui {
|
||||||
btn.weightx = 0.0;
|
btn.weightx = 0.0;
|
||||||
btn.weighty = 0.0;
|
btn.weighty = 0.0;
|
||||||
btn.anchor = GridBagConstraints.SOUTHEAST;
|
btn.anchor = GridBagConstraints.SOUTHEAST;
|
||||||
btn.insets = new Insets(10, 0, 0, 10);
|
btn.insets = new Insets(10, 0, 0, 0);
|
||||||
|
|
||||||
chessPanel.add(flipBoardButton, btn);
|
chessPanel.add(flipBoardButton, btn);
|
||||||
|
|
||||||
|
|
@ -158,7 +157,7 @@ public class GameGui {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Invertiere Zeilen und Spalten!
|
// Invertiere Zeilen und Spalten
|
||||||
for (int row = 0; row < 8; row++) {
|
for (int row = 0; row < 8; row++) {
|
||||||
for (int col = 0; col < 8; col++) {
|
for (int col = 0; col < 8; col++) {
|
||||||
PieceDTO piece = board[7 - row][7 - col];
|
PieceDTO piece = board[7 - row][7 - col];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue