I used the internet as a resource to help me make a JButton but for some reason I cannot get it to a normal size. I have changed the dimensions and messes around a lot but it is not working.
Here is my code:
import javax.swing.*;
import java.awt.*;
public class ScreenSaver {
public static void main(String[] args) {
JFrame frame = new JFrame();
JButton button = new JButton();
JPanel panel = new JPanel();
button.setSize(100, 100);
panel.add(button);
frame = new JFrame ("Screen Saver");
frame.setSize(Toolkit.getDefaultToolkit().getScreenSize());
frame.setUndecorated(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setContentPane(panel);
frame.setBackground(new Color(1.0f,1.0f,1.0f,0.1f));
frame.setResizable(true);
frame.setVisible(true);
}
}