Add window icon to new dialogs
This commit is contained in:
parent
c00983843a
commit
541e579401
|
@ -20,6 +20,7 @@ import net.lingala.zip4j.ZipFile;
|
|||
import net.lingala.zip4j.exception.ZipException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.*;
|
||||
import javax.swing.filechooser.FileFilter;
|
||||
import javax.swing.filechooser.FileNameExtensionFilter;
|
||||
|
@ -28,7 +29,9 @@ import java.awt.event.ActionEvent;
|
|||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import static javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE;
|
||||
|
||||
|
@ -56,6 +59,12 @@ public class Clifford implements ActionListener {
|
|||
creating = false;
|
||||
|
||||
frame.add(frameContainer);
|
||||
try {
|
||||
BufferedImage windowIcon = ImageIO.read(new File(System.getProperty("user.dir") + "/resources/titleIcon.png"));
|
||||
frame.setIconImage(windowIcon);
|
||||
} catch (IOException e) {
|
||||
System.out.println("ERROR: Failed to find /resources/titleIcon.png. Window will not have an icon.");
|
||||
}
|
||||
frame.setSize(600, 300); // 1280 800
|
||||
frame.setMinimumSize(new Dimension(200,100));
|
||||
frame.setTitle("Options");
|
||||
|
|
|
@ -18,12 +18,14 @@
|
|||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
|
@ -43,6 +45,12 @@ public class Waldorf implements ActionListener {
|
|||
invoker = inv;
|
||||
|
||||
frame.add(frameContainer);
|
||||
try {
|
||||
BufferedImage windowIcon = ImageIO.read(new File(System.getProperty("user.dir") + "/resources/titleIcon.png"));
|
||||
frame.setIconImage(windowIcon);
|
||||
} catch (IOException e) {
|
||||
System.out.println("ERROR: Failed to find /resources/titleIcon.png. Window will not have an icon.");
|
||||
}
|
||||
frame.setSize(600, 200); // 1280 800
|
||||
frame.setMinimumSize(new Dimension(200,100));
|
||||
frame.setTitle("Options");
|
||||
|
|
Loading…
Reference in New Issue
Block a user