import java.awt.*; import javax.swing.*; public class MyButtonExample extends JFrame { private JButton myButton; public MyButtonExample() { super("My Button Example"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setSize(300, 200); myButton = new JButton("Click me!"); add(myButton); // Disable the button initially myButton.setEnabled(false); setVisible(true); } // Enable the button if a particular condition is met public void enableButton() { myButton.setEnabled(true); } public static void main(String[] args) { MyButtonExample example = new MyButtonExample(); // Call enableButton() to enable the button example.enableButton(); } }In this example, we create a JFrame with a single JButton. We initially disable the button using the setEnabled() method. Later, we call the enableButton() method to enable the button when a particular condition is met. The package library used in this example is java.awt.