Advertisement
Alfoli

Exercicio 1 nomes

Feb 20th, 2020
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.66 KB | None | 0 0
  1. package nomes;
  2.  
  3. import java.awt.BorderLayout;
  4. import java.awt.GridLayout;
  5. import java.awt.FlowLayout;
  6. import java.awt.event.ActionEvent;
  7. import java.awt.event.ActionListener;
  8. import java.util.HashSet;
  9. import javax.swing.JFrame;
  10. import javax.swing.JButton;
  11. import javax.swing.JPanel;
  12. import javax.swing.JLabel;
  13. import javax.swing.JTextField;
  14. import javax.swing.SwingConstants;
  15.  
  16. public class Nomes extends JFrame implements ActionListener{
  17.     JButton btnTamanho, btnMaius, btnMinus, btnLimpar;
  18.     JTextField texto;
  19.     JLabel txtEntrada, txtTamanho, txtTam;
  20.     public Nomes(){
  21.         setLayout (new BorderLayout());
  22.         btnTamanho = new JButton("tamanho");
  23.         btnMaius = new JButton ("Maiusculo");
  24.         btnMinus = new JButton ("Minusculo");
  25.         btnLimpar = new JButton ("Limpar");
  26.         JPanel sul = new JPanel (new GridLayout(2,2));
  27.         sul.add(btnTamanho);
  28.         sul.add(btnMaius);
  29.         sul.add(btnMinus);
  30.         sul.add(btnLimpar);
  31.         add (sul, BorderLayout.SOUTH);
  32.     }
  33.    
  34.     public void actionPerformed (ActionEvent e){
  35.         if (e.getSource ()== btnLimpar){
  36.             texto.setText("");
  37.             textIam.setText("");
  38.            
  39.         }
  40.     }
  41.    
  42.     public static void main (String [] args){
  43.     Nomes tela = new Nomes ();
  44.     tela.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  45.     tela.setSize (350,250);
  46.     tela.setLocation (500,300);
  47.     tela.setVisible(true);
  48.    
  49.    
  50.  
  51.  
  52. }
  53.  
  54.     @Override
  55.     public void actionPerformed(ActionEvent e) {
  56.         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
  57.     }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement