i already did this but it doesn't change the icon.
public GuiMsV2() {
setTitle(" Magic Square");
setSize(500,130);
setLocation((1024-200)/2,(768-700)/2);
ImageIcon ImageIcon = new ImageIcon("d:\\16x16.jpg"); //these are the added code
Image Image = ImageIcon.getImage(); //these are the added code
this.setIconImage(Image); //these are the added code
inputPanel.setLayout(new GridLayout(4,2));
buttonsPanel.setLayout(new GridLayout(1,2));
inputPanel.add(lbl_1); inputPanel.add(txt_dimension);
inputPanel.add(lbl_2); inputPanel.add(lbl_space);
inputPanel.add(lbl_x); inputPanel.add(txt_x);
inputPanel.add(lbl_y); inputPanel.add(txt_y);
buttonsPanel.add(btn_solve);
buttonsPanel.add(btn_clear);
btn_solve.addActionListener(this);
btn_clear.addActionListener(this);
add(inputPanel,BorderLayout.NORTH);
add(buttonsPanel,BorderLayout.CENTER);
setResizable(false);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setVisible(true);
}

New Topic/Question
Reply




MultiQuote




|