Skip to content

Instantly share code, notes, and snippets.

@danggrianto
Last active December 23, 2015 10:49
Show Gist options
  • Select an option

  • Save danggrianto/6624087 to your computer and use it in GitHub Desktop.

Select an option

Save danggrianto/6624087 to your computer and use it in GitHub Desktop.
basic GUI
public class BasicGUI {
public static void main(String[] args) {
JFrame frame = new JFrame();
JPanel pane1 = new JPanel();
JPanel pane2 = new JPanel();
frame.add(pane1, BorderLayout.WEST);
frame.add(pane2, BorderLayout.EAST);
// JFrame frame = new JFrame ("Button Pannel");
// JPanel panel = new JPanel();
// JPanel p = new JPanel(new BorderLayout());
// panel.setLayout(null);
JButton buttonOne = new JButton("Button One");
// quitButton.addActionListener(new ActionListener() {
// @Override
// public void actionPerformed(ActionEvent event) {
// System.exit(0);
// }
// });
frame.setSize (600, 200);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// frame.add(new JButton ("OK"));
}
}
@tnhansel

Copy link
Copy Markdown

ok... I'll try

@danggrianto

Copy link
Copy Markdown
Author

actually sel.. it is fine using that class definition you dont need to extend it...
dude do you even use buttonOne object? buttonOne object is never called....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment