Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package paket;
- import java.awt.FlowLayout;
- import java.awt.Font;
- import java.awt.GridLayout;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import javax.swing.JButton;
- import javax.swing.JFrame;
- import javax.swing.JTextField;
- public class Calculator extends JFrame {
- JButton[][] b;
- JFrame calculator;
- JTextField display = new JTextField();
- public Calculator() {
- b = new JButton[4][6];
- setSize(500, 350);
- this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- setLayout(new FlowLayout(FlowLayout.CENTER));
- this.add(display);
- this.setLayout(new GridLayout(4, 6));
- //*for (int i = 0; i < 4; i++) {
- //*for (int j = 0; j < 6; j++) {
- //* b[i][j] = new JButton();
- //* this.add(b[i][j]);
- //*}
- //*}
- }
- public static void main(String[] args) {
- Calculator c = new Calculator();
- c.setVisible(true);
- }
- }
Add Comment
Please, Sign In to add comment