Buongiorno,
sto facendo un semplice programma con interfaccia ma ho qualche problema di sovrascrittura e non capisco quale sia il problema.grazie per l'aiuto
codice:import java.awt.*; import java.awt.event.*; class GUIEsameVecchio extends Frame { TextField t = new TextField(10); Label la = new Label("Massimo = "); Label lb = new Label(" 0 "); int max = 0; public GUIEsameVecchio() { super("Massimo"); Panel p2 = new Panel(); p2.add(la); p2.add(lb); add(t); add(p2,BorderLayout.NORTH); t.addActionListener(new Ascoltatore(t,lb)); Chiudi asc = new Chiudi(); addWindowListener(asc); setVisible(true); pack(); } } class Ascoltatore implements ActionListener { //ERRORE nell'ascoltatore private TextField t; private Label lb; private int max; public Ascoltatore (TextField t, Label lb) { this.t = t; this.lb = lb; } public void actionPerfomerd(ActionEvent e) { int n = Integer.parseInt(t.getText()); if(n>=max) { lb.setText(n+""); } } } class Chiudi extends WindowAdapter{ public void windowClosed(WindowEvent e) { System.exit(0); } public void windowClosing(WindowEvent e) { e.getWindow().dispose(); } } class UsoGUIEsameVecchio{ public static void main (String[] args) { GUIEsameVecchio elena = new GUIEsameVecchio(); } }