Advertisement
gtw7375

JAVA, GUI, TAPA NA XERECA

Sep 3rd, 2014
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.84 KB | None | 0 0
  1. import java.awt.*;
  2. import javax.swing.*;
  3.  
  4. public class Classe extends JFrame {
  5.  
  6.     JButton cadastro = new JButton("Cadastro");
  7.     JTextField login = new JTextField();
  8.     JPasswordField senha = new JPasswordField();
  9.    
  10.         public Classe() {
  11.            
  12.             setSize(400,500);
  13.             setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  14.             setTitle("INTERFACE GRÁFICA JAVA");
  15.             setLocation(450,100);
  16.             getContentPane().setLayout(null);
  17.            
  18.             cadastro.setBounds(120, 220, 100, 20);
  19.             getContentPane().add(cadastro);
  20.            
  21.             login.setBounds(100, 140, 140, 30);
  22.             getContentPane().add(login);
  23.            
  24.             senha.setBounds(100, 175, 140, 30);
  25.             senha.setEchoChar('$');
  26.             getContentPane().add(senha);
  27.            
  28.            
  29.         }
  30.        
  31.        
  32.     public static void main(String[] args) {
  33.    
  34.             Classe janela = new Classe();
  35.             janela.setVisible(true);
  36.             janela.show();
  37.            
  38.     }
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement