Hello friends.I got some problems with a program I'm developing for a assignment. I want to add a image(background) to my Jframe and add some buttons. I wrote the code. I can load image into the frame but when I create the Jbutton and re-size it to smaller button it's not minimizing. the button shows all over the frame.. is there any solution.. ? thank you
import java.awt.Dimension;
import javax.swing.*;
public class GUItest01 extends JFrame {
public static void main(String[] args) {
JFrame frame = new JFrame("main");
frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
ImageIcon ii = new ImageIcon("C:/icon.jpg");
JLabel lable = new JLabel(ii);
JScrollPane jsp = new JScrollPane(lable);
frame.getContentPane().add(jsp);
frame. setSize(1000, 700);
JButton button = new JButton();
button.setSize(new Dimension(50, 50));
button.setLocation(500, 350);
frame.getContentPane().add(button);
frame.setVisible(true);
}
}