Skip to content

Commit

Permalink
fix: fix some gui related bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
smartcmd committed May 24, 2024
1 parent c4b2a19 commit 4a21484
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
23 changes: 14 additions & 9 deletions Allay-Server/src/main/java/org/allaymc/server/gui/Dashboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,20 @@ protected void updateOnlinePlayerCount() {
protected void updateOnlinePlayerTable() {
var title = new String[] {"Name", "Address", "UUID"};
var players = Server.getInstance().getOnlinePlayers().values();
var data = new String[3][players.size() - 1];
int row = 0;
for (var player : players) {
data[row] = new String[] {
player.getOriginName(),
player.getClientSession().getSocketAddress().toString(),
player.getUUID().toString()
};
row++;
String[][] data;
if (players.isEmpty()) {
data = new String[3][0];
} else {
data = new String[3][players.size() - 1];
int row = 0;
for (var player : players) {
data[row] = new String[]{
player.getOriginName(),
player.getClientSession().getSocketAddress().toString(),
player.getUUID().toString()
};
row++;
}
}
var model = new UneditableDefaultTableModel(data, title);
SwingUtilities.invokeLater(() -> playerTable.setModel(model));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public final class GraphPanel extends JPanel {
private final static Color textColor = Color.WHITE;
private final static Color backgroundColor = Color.DARK_GRAY;
private final static Color lineColor = new Color(44, 102, 230, 255);
private final static Color pointColor = new Color(100, 100, 100, 255);
private final static Color pointColor = Color.LIGHT_GRAY;
private final static Color gridColor = Color.GRAY;
private static final Stroke graphStroke = new BasicStroke(2f);
private final List<Integer> values = new ArrayList<>(50);
Expand Down

0 comments on commit 4a21484

Please sign in to comment.