Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package nomes;
- import java.awt.BorderLayout;
- import java.awt.GridLayout;
- import java.awt.FlowLayout;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.util.HashSet;
- import javax.swing.JFrame;
- import javax.swing.JButton;
- import javax.swing.JPanel;
- import javax.swing.JLabel;
- import javax.swing.JTextField;
- import javax.swing.SwingConstants;
- public class Nomes extends JFrame implements ActionListener{
- JButton btnTamanho, btnMaius, btnMinus, btnLimpar;
- JTextField texto;
- JLabel txtEntrada, txtTamanho, txtTam;
- public Nomes(){
- setLayout (new BorderLayout());
- btnTamanho = new JButton("tamanho");
- btnMaius = new JButton ("Maiusculo");
- btnMinus = new JButton ("Minusculo");
- btnLimpar = new JButton ("Limpar");
- JPanel sul = new JPanel (new GridLayout(2,2));
- sul.add(btnTamanho);
- sul.add(btnMaius);
- sul.add(btnMinus);
- sul.add(btnLimpar);
- add (sul, BorderLayout.SOUTH);
- }
- public void actionPerformed (ActionEvent e){
- if (e.getSource ()== btnLimpar){
- texto.setText("");
- textIam.setText("");
- }
- }
- public static void main (String [] args){
- Nomes tela = new Nomes ();
- tela.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- tela.setSize (350,250);
- tela.setLocation (500,300);
- tela.setVisible(true);
- }
- @Override
- public void actionPerformed(ActionEvent e) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement