Skip to content

Commit

Permalink
add logo to splash screen
Browse files Browse the repository at this point in the history
  • Loading branch information
creme332 committed Jul 12, 2024
1 parent a1800a8 commit 56c0c84
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/main/java/com/github/creme332/view/SplashScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,31 @@
import java.awt.*;
import javax.swing.*;

import com.github.creme332.utils.IconLoader;
import com.github.creme332.utils.exception.InvalidPathException;

public class SplashScreen extends JPanel {
JLabel text = new JLabel("polydraw");

SplashScreen() {
setLayout(new GridBagLayout());

text.putClientProperty("FlatLaf.style", "font: 340% $large.font");
GridBagConstraints gbc = new GridBagConstraints();

text.putClientProperty("FlatLaf.style", "font: 260% $large.font");
gbc.gridx = 0;
gbc.gridy = 0;
gbc.gridy = 1;
this.add(text, gbc);

this.add(text);
JLabel x = new JLabel();
try {
x.setIcon(IconLoader.loadIcon("/icons/icosahedron.png"));
} catch (InvalidPathException e) {
e.printStackTrace();
System.exit(0);
}

gbc.gridx = 0;
gbc.gridy = 0;
this.add(x, gbc);
}
}

0 comments on commit 56c0c84

Please sign in to comment.