Finnthahuman

Untitled

Mar 1st, 2021
544
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. import java.awt.event.ActionEvent;
  3. import java.awt.event.ActionListener;
  4. import java.util.ArrayList;
  5.  
  6. import javax.swing.JButton;
  7. import javax.swing.JFrame;
  8. import javax.swing.JLabel;
  9. import javax.swing.JTextArea;
  10. import javax.swing.JTextField;
  11.  
  12. /*
  13.  * To change this license header, choose License Headers in Project Properties.
  14.  * To change this template file, choose Tools | Templates
  15.  * and open the template in the editor.
  16.  */
  17.  
  18. /**
  19.  *
  20.  * @author rolandosucco
  21.  */
  22. public class Main implements ActionListener{
  23.      private ArrayList<Contribuente> c=new ArrayList();
  24.     private JFrame finestra;
  25.     private JTextField codice,entrate,uscite;
  26.     private JTextArea risultato;
  27.     public Main() {
  28.         finestra=new JFrame("Fisco");
  29.         finestra.setSize(500,500);
  30.         finestra.setLayout(null);
  31.        
  32.         JLabel l1,l2,l3,l4;
  33.         l1=new JLabel("Cod.fisc o P.Iva");
  34.         l1.setBounds(10, 10, 100, 20);
  35.         finestra.add(l1);
  36.        
  37.         codice= new JTextField();
  38.         codice.setBounds(120,10,100,20);
  39.         finestra.add(codice);
  40.        
  41.         l2= new JLabel("entrate");
  42.         l2.setBounds(10,40,100,20);
  43.         finestra.add(l2);
  44.         entrate= new JTextField();
  45.         entrate.setBounds(120, 40, 100, 20);
  46.         finestra.add(entrate);
  47.        
  48.         l3= new JLabel("uscite");
  49.         l3.setBounds(250,40,100,20);
  50.         finestra.add(l3);
  51.         uscite= new JTextField();
  52.         uscite.setBounds(360, 40, 100, 20);
  53.         finestra.add(uscite);
  54.        
  55.        
  56.         risultato= new JTextArea();
  57.         risultato.setBounds(50, 120, 300, 200);
  58.         finestra.add(risultato);
  59.        
  60.        
  61.         JButton fisica,giuridica,calcola;
  62.         fisica= new JButton("fisica");
  63.         giuridica=new JButton("giuridica");
  64.         calcola= new JButton("calcola");
  65.        
  66.        
  67.         fisica.setBounds(360, 120, 100, 20);
  68.         giuridica.setBounds(360, 150 , 100, 20);
  69.         calcola.setBounds(360,180 , 100, 20);
  70.        
  71.         finestra.add(fisica);
  72.         finestra.add(giuridica);
  73.         finestra.add(calcola);
  74.        
  75.         fisica.addActionListener(this);
  76.         giuridica.addActionListener(new Ascoltatore(this));
  77.        
  78.        
  79.        
  80.        
  81.        
  82.         finestra.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  83.  
  84.         finestra.setVisible(true);
  85.     }
  86.    
  87.     public static void main(String[] args) {
  88.     new Main();
  89.      
  90.     }
  91.  
  92.     @Override
  93.     public void actionPerformed(ActionEvent e) {
  94. System.out.println(e.getSource());
  95.        
  96.     }
  97.    
  98. }
  99.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×