dcsimg
Responding to awt event from swt component
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Hariharan_LakshmiNarayanan
Posted On:   Tuesday, January 25, 2005 12:47 AM

Hi, I'm using an AWT Button inside a AWT panel.On Click of that button I want to show an SWT Window.I pass The display object to the constructor of the swt window so that there is no illegal thread access error. (ie) I'm using a single display object throughout the application.But when I call the constructor from actionPerformed () method I'm getting the illegal thread access error. How to solve the problem. But when I call the same constructor from widgetSelected() method, I'm not getting any errors.I have given both the codes below. //working code public void widgetSelected (SelectionEvent se) { if (se.getSource ().equals (miDeleteForm)) { VFAddNewFormField anff = new VFAddNewFormField disp, con); anff   More>>

Hi,
I'm using an AWT Button inside a AWT panel.On Click of that button I want to show an SWT Window.I pass The display object to the constructor of the swt window so that there is no illegal thread access error. (ie) I'm using a single display object throughout the application.But when I call the constructor from actionPerformed () method I'm getting the illegal thread access error. How to solve the problem.
But when I call the same constructor from widgetSelected() method, I'm not getting any errors.I have given both the codes below.

//working code
public void widgetSelected (SelectionEvent se) {
if (se.getSource ().equals (miDeleteForm)) {
VFAddNewFormField anff = new VFAddNewFormField disp, con);
anff.showWindow ();
}
}

//Not working

public void actionPerformed(ActionEvent ae) {
if (ae.getSource ().equals (miDeleteForm)) {
VFAddNewFormField anff = new VFAddNewFormField disp, con);
anff.showWindow ();
}
}

Please tell me how to solve this problem

   <<Less
About | Sitemap | Contact