File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 2929import java .awt .Font ;
3030import javax .swing .Box ;
3131import javax .swing .BoxLayout ;
32- import java . awt . Toolkit ;
32+
3333import java .awt .Image ;
3434import javax .swing .ImageIcon ;
35+ import java .io .*;
3536
3637public 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 );
You can’t perform that action at this time.
0 commit comments