Jar compiling is now possible

This commit is contained in:
2018-01-26 23:15:19 +01:00
parent 1fafab78b6
commit 55c7c8defd
6 changed files with 43 additions and 33 deletions

View File

@ -1,8 +1,10 @@
package net.knarcraft.serverlauncher.userinterface;
import javax.imageio.ImageIO;
import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.*;
import java.io.IOException;
/**
* A class for creating the gui.
@ -15,18 +17,17 @@ public class GUI {
public GUI() {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (UnsupportedLookAndFeelException e) {
} catch (ClassNotFoundException | UnsupportedLookAndFeelException | InstantiationException | IllegalAccessException e) {
e.printStackTrace();
}
JFrame frame = new JFrame("Minecraft server launcher");
ImageIcon img = new ImageIcon("files/GUIIcon.png");
ImageIcon img;
try {
img = new ImageIcon(ImageIO.read(GUI.class.getResourceAsStream("/files/GUIIcon.png")));
} catch (IOException | IllegalArgumentException e) {
img = new ImageIcon("files/GUIIcon.png");
}
frame.setIconImage(img.getImage());
frame.setLocation(0,0);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);