Last active
December 23, 2015 10:49
-
-
Save danggrianto/6624087 to your computer and use it in GitHub Desktop.
basic GUI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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")); | |
| } | |
| } |
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
ok... I'll try