Skip to content

Commit

Permalink
feat: Menambahkan program baru
Browse files Browse the repository at this point in the history
  • Loading branch information
dean-fahreza committed Jan 9, 2022
1 parent 21ea4b7 commit b12ad99
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import javax.swing.*;

public class JButtonJPanel {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
createAndShowGUI();
}
});
}
private static void createAndShowGUI() {
JFrame frame = new JFrame("Ini adalah JFrame");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setBounds(20, 30, 300, 100);
frame.setLayout(null);

JButton button = new JButton("Click Me");
frame.getContentPane().add(button);
button.setBounds(20,20,200,20);
frame.setVisible(true);
}
}

0 comments on commit b12ad99

Please sign in to comment.