Skip to content

Commit

Permalink
Merge pull request #80 from bellshade/Dean
Browse files Browse the repository at this point in the history
feat: Menambahkan program baru
  • Loading branch information
dean-fahreza authored Jan 10, 2022
2 parents 133fbf0 + b12ad99 commit ea0dba8
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 ea0dba8

Please sign in to comment.