Oppure

Loading
13/02/11 11:59
hackme
vi metto tutto il codice...

classe 1:

import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;



public class pwd {

	public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException {
		UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
		finestra f = new finestra();
	}

}


classe 2:

import javax.swing.*;

public class finestra extends JFrame{
	public JFrame finestra;
	public JButton bottone1;
	public JList list1;
	
	finestra(){
		
		bottone1 = new JButton("add");
		bottone1.setBounds(10,10, 40, 40);
		[b]bottone1.addActionListener(new add());[/b]
		
		list1 = new JList();
		list1.setBounds(10, 60, 230, 250);
		
		finestra = new JFrame("PwdManager hackme-java-programs©");
		finestra.setSize(400, 350);
		finestra.setResizable(false);
		finestra.setLayout(null);
		finestra.setDefaultCloseOperation(EXIT_ON_CLOSE);
		finestra.setLocationRelativeTo(null);
		finestra.setVisible(true);
		finestra.add(list1);
		finestra.add(bottone1);
	}
	
}




classe 3:

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JOptionPane;


[b]public class add extends finestra implements ActionListener {[/b]

	public String addpwd;
	public void actionPerformed(ActionEvent arg0) {
		addpwd = JOptionPane.showInputDialog(null, "add password:", "PwdManager - addpassword", JOptionPane.INFORMATION_MESSAGE);	
	}

}



perchè non riesce ad ereditare la classe mi da errore nelle parti segnate in grassetto + Exception in thread "main" java.lang.StackOverflowError

aiutatemi perfavore... :hail:
aaa