Skip to content

Commit f82b2b8

Browse files
committed
Added application icon :)
1 parent 5ea57cd commit f82b2b8

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

src/main/java/org/pwss/Start.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.pwss;
22

3+
import javax.imageio.ImageIO;
34
import javax.swing.*;
45

56
import com.formdev.flatlaf.FlatDarculaLaf;
@@ -9,6 +10,10 @@
910
import org.pwss.controller.factory.AppControllerFactory;
1011
import org.pwss.controller.factory.ControllerFactory;
1112

13+
import java.awt.*;
14+
import java.io.IOException;
15+
import java.util.Objects;
16+
1217
public class Start {
1318
public static void main(String[] args) {
1419
try {
@@ -23,6 +28,14 @@ public static void main(String[] args) {
2328
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
2429
frame.setLocationRelativeTo(null); // center on screen
2530

31+
// Application icon
32+
try {
33+
Image icon = ImageIO.read(Objects.requireNonNull(Start.class.getResource("/app-icon.png")));
34+
frame.setIconImage(icon);
35+
} catch (IOException e) {
36+
System.err.println("Failed to load application icon: " + e.getMessage());
37+
}
38+
2639
// Create controller factory
2740
final ControllerFactory factory = new AppControllerFactory();
2841

src/main/resources/app-icon.png

1.42 MB
Loading

0 commit comments

Comments
 (0)