Ali this is what i have now done, but i am now getting the error non static method getClass() cannot be referenced from a static context
buttonc = new JButton("6");
cc.fill = GridBagConstraints.HORIZONTAL;
cc.ipady = 20; //reset to default
cc.weightx = 0.0; //request any extra vertical space
// c.anchor = GridBagConstraints.LAST_LINE_START; //bottom of space
// c.insets = new Insets(10,0,0,0); //top padding
cc.gridx = 1; //aligned with button 2
cc.gridwidth = 1; //2 columns wide
cc.gridy = 2; //third row
pane.add(button, cc);
try{
Image img = ImageIO.read(getClass().getResource("gui/UpdateLib.png"));
Image resize = img.getScaledInstance(290, 180, java.awt.Image.SCALE_SMOOTH);
buttonc.setIcon(new ImageIcon(resize));
}catch(Exception e){
}