Skip to content

Commit ed8de4e

Browse files
Update UI.java
1 parent 24530f4 commit ed8de4e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/simplejavacalculator/UI.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@
2929
import java.awt.Font;
3030
import javax.swing.Box;
3131
import javax.swing.BoxLayout;
32-
import java.awt.Toolkit;
32+
3333
import java.awt.Image;
3434
import javax.swing.ImageIcon;
35+
import java.io.*;
3536

3637
public class UI implements ActionListener {
3738

@@ -58,12 +59,14 @@ public class UI implements ActionListener {
5859

5960
private final Font font;
6061
private final Font textFont;
61-
ImageIcon image;
62+
private ImageIcon image;
63+
private BufferedImageCustom imageReturn;
6264

63-
public UI() {
65+
public UI() throws IOException {
6466
frame = new JFrame("Calculator PH");
6567

66-
image = new ImageIcon("/icon/icon.png");
68+
imageReturn = new BufferedImageCustom();
69+
image = new ImageIcon(imageReturn.imageReturn());
6770

6871
panel = new JPanel();
6972
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
@@ -114,6 +117,7 @@ public void init() {
114117
frame.setLocationRelativeTo(null);
115118
frame.setResizable(false);
116119
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
120+
117121
frame.setIconImage(image.getImage());
118122

119123
text.setFont(textFont);

0 commit comments

Comments
 (0)