import java.awt.*; import javax.swing.*; public class SetBoundsExample { public static void main(String[] args) { JFrame frame = new JFrame("Set Bounds Example"); JButton button = new JButton("Click Me!"); button.setBounds(50, 50, 100, 30); frame.add(button); frame.setSize(200, 150); frame.setLayout(null); frame.setVisible(true); } }In this example, we create a JFrame and a JButton. We use the setBounds() method to set the size and position of the button. We then add the button to the JFrame, set the size of the JFrame, turn off the layout manager, and make the JFrame visible. Package Library: java.awt* is a package library.