Why VE calls actionPreformed Listeners? [message #618418] |
Tue, 20 July 2010 06:02 |
Eclipse User |
|
|
|
Originally posted by: fbondioli.autentiweb.com
Hi all,
I'm using eclipse 3.5.2 and VE 1.4 for design Swing applications.
I've noticed that VE often follows actionPerformed events linked to object and this produces very often unpredictable results.
For example in the code below, the method "inserisciNuovoCliente()" is called by the VE during setup and prevent it to display the frame correctly. If I comment
the call to inserisciNuovoCliente() the frame is displayed OK.
Is there a way to prevent this behaviour?
private JButton getBtInsNuovoCliente() {
if (btInsNuovoCliente == null) {
btInsNuovoCliente = new JButton();
btInsNuovoCliente.setText("Inserisci nuovo cliente");
btInsNuovoCliente.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
new Thread() {
public void run() {
inserisciNuovoCliente();
}
}.start();
}
});
}
return btInsNuovoCliente;
}
private void inserisciNuovoCliente() {
Anagrafica cli = new Anagrafica();
cli.setCliente(true);
FrameSchedaAnagrafica fsa = new FrameSchedaAnagrafica(cli);
UIUtils.showModalInternalFrame(fsa, StoreClientGlobal.desktopPane, this);
cli = fsa.getAnagObject();
if (cli.getId() != null) {
try {
ddtObject.setDestinatario(cli);
detailPanel.toControl(txtFornitore);
//txtFornitore.setBoundValue(cli);
} catch (Exception e) {
e.printStackTrace();
}
}
StoreClientGlobal.desktopPane.remove(fsa);
fsa.dispose();
}
|
|
|
Powered by
FUDForum. Page generated in 0.01690 seconds