Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package paternivezbanje;
- import javax.swing.*;
- /**
- *
- * @author maja
- */
- public class Form extends JFrame{
- public Form(){
- initComponents();
- }
- private JButton btnSum;
- private JButton btnSub;
- private JTextField txtA;
- private JTextField txtB;
- private JTextField txtResult;
- private JLabel lblA;
- private JLabel lblB;
- private JLabel lblresult;
- private void initComponents() {
- btnSub = new JButton();
- btnSum = new JButton();
- txtA = new JTextField();
- txtB = new JTextField();
- txtResult = new JTextField();
- lblA = new JLabel();
- lblB = new JLabel();
- lblresult = new JLabel();
- txtResult.setEditable(false);
- setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
- getContentPane().setLayout(null);
- btnSub.setText("Sub");
- getContentPane().add(btnSub);
- btnSub.setBounds(20, 220, 72, 29);
- btnSum.setText("Sum");
- getContentPane().add(btnSum);
- btnSum.setBounds(130, 220, 72, 29);
- getContentPane().add(txtA);
- txtA.setBounds(100, 30, 86, 27);
- getContentPane().add(txtB);
- txtB.setBounds(100, 90, 86, 27);
- getContentPane().add(txtResult);
- txtResult.setBounds(100, 150, 86, 27);
- lblA.setText("A:");
- getContentPane().add(lblA);
- lblA.setBounds(10, 30, 49, 17);
- lblB.setText("B:");
- getContentPane().add(lblB);
- lblB.setBounds(10, 90, 49, 17);
- lblresult.setText("Result:");
- getContentPane().add(lblresult);
- lblresult.setBounds(10, 150, 49, 17);
- pack();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement