Hello guys, I really hope you can help me with this one, right now I created a new project at eclipse with this code pasted inside a domApli container in a java file, I tried to run it but it wont work, any help you could give me to see what's wrong? Please try to be very specific as I am new at Java and I am still trying to catch some concepts:
package domApli; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Prg2 extends JFrame implements ActionListener{ JLabel lblNom; JLabel lblEdad; JTextField txtNom; JTextField txtEdad; JTextArea txtS; JScrollPane scpScroll; JButton btnProcesar; public static void main(String[] args) { new Prg2(); } public Prg2(){ getContentPane().setLayout(null); getContentPane().setBackground(Color.orange); lblNom=new JLabel("Nombre"); lblNom.setBounds(10,10,80,20); getContentPane().add(lblNom); lblEdad=new JLabel("Edad"); lblEdad.setBounds(10,40,80,20); getContentPane().add(lblEdad); txtNom=new JTextField(); txtNom.setBounds(100,10,80,20); getContentPane().add(txtNom); txtEdad=new JTextField(); txtEdad.setBounds(100,40,80,20); getContentPane().add(txtEdad); btnProcesar=new JButton("Procesar"); btnProcesar.setBounds(190,10,100,20); btnProcesar.addActionListener(this); getContentPane().add(btnProcesar); txtS=new JTextArea(); scpScroll=new JScrollPane(txtS); scpScroll.setBounds(10,70,280,180); getContentPane().add(scpScroll); setSize(315,310); setTitle("Prg2"); setVisible(true); } public void actionPerformed(ActionEvent e){ if(e.getSource()==btnProcesar){ procesar(); } } void imprimir(String cad){ txtS.setText("\n"+cad); } void borrar(){ txtNom.setText(""); txtEdad.setText(""); txtS.setText(""); txtNom.requestFocus(); } public void procesar(){ String nom; int edad; String email; String pwd; nom=getNombre(); if(nom.length()<3){ JOptionPane.showMessageDialog(this,"ERROR: Ingrese un nombre con por lo menos 3 letras"); borrar(); } else{ edad=getEdad(); email=generarEmail(nom,edad); pwd=generarPwd(nom); imprimir("Email:\t"+email +"\nPass:\t"+pwd); } } public String generarEmail(String nom, int ed){ return nom+ed+nom.charAt(0)+"@usmp.pe"; } int generarAleatorio(int min,int max){ return (int)((max-min+1)*Math.random()+min); } public String generarPwd(String nom){ int n1=generarAleatorio(0,9); int n2=generarAleatorio(0,9); int n3=generarAleatorio(0,9); String letra1=(""+nom.charAt(0)).toUpperCase(); String letra2=(""+nom.charAt(1)).toUpperCase(); String letra3=(""+nom.charAt(2)).toUpperCase(); return letra1+n1+letra2+n2+letra3+n3; } public String getNombre(){ return txtNom.getText(); } public int getEdad(){ return Integer.parseInt(txtEdad.getText()); } }