Skip to content

Commit

Permalink
feat: add icon for GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
smartcmd committed May 24, 2024
1 parent 3297937 commit 9f258b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import java.awt.*;
import java.net.URL;
import java.util.stream.Collectors;

/**
Expand Down Expand Up @@ -44,6 +45,13 @@ public static Dashboard getInstance() {
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(600, 600);
frame.setLocationRelativeTo(null);
// Set icon
URL image = Dashboard.class.getClassLoader().getResource("icon.png");
if (image != null) {
ImageIcon icon = new ImageIcon(image);
frame.setIconImage(icon.getImage());
}
// Show the frame
frame.setVisible(true);

var server = Server.getInstance();
Expand Down
Binary file added Allay-Server/src/main/resources/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9f258b5

Please sign in to comment.