daily pastebin goal
53%
SHARE
TWEET

Untitled

a guest Jan 12th, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package paket;
  2.  
  3. import java.awt.FlowLayout;
  4. import java.awt.Font;
  5. import java.awt.GridLayout;
  6. import java.awt.event.ActionEvent;
  7. import java.awt.event.ActionListener;
  8.  
  9. import javax.swing.JButton;
  10. import javax.swing.JFrame;
  11. import javax.swing.JTextField;
  12.  
  13.  
  14. public class Calculator extends JFrame {
  15.    
  16.     JButton[][] b;
  17.     JFrame calculator;
  18.     JTextField display = new JTextField();
  19.    
  20.     public Calculator() {
  21.  
  22.         b = new JButton[4][6];
  23.         setSize(500, 350);
  24.         this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  25.         setLayout(new FlowLayout(FlowLayout.CENTER));
  26.         this.add(display);
  27.         this.setLayout(new GridLayout(4, 6));
  28.         //*for (int i = 0; i < 4; i++) {
  29.         //*for (int j = 0; j < 6; j++) {           
  30.             //* b[i][j] = new JButton();
  31.             //* this.add(b[i][j]);
  32.             //*}
  33.         //*}
  34.     }
  35.    
  36.  
  37.    
  38.     public static void main(String[] args) {
  39.         Calculator c = new Calculator();
  40.         c.setVisible(true);
  41.     }
  42. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top