Rajesh Kumar Dash
Rajesh Kumar Dash

Reputation: 29

How can I dispose a widget in swt and again create that widget in the same place?

I am developing a swt application where I want to dispose a button and again want to recreate that in the same place. But I am getting widget is disposed error. How can I do it? o

Upvotes: 2

Views: 702

Answers (2)

Alessandro Atria
Alessandro Atria

Reputation: 96

If you are not using GridLayout, you can set button invisible invoking Control:setVisibile(boolean).

Upvotes: 0

Waqas Ilyas
Waqas Ilyas

Reputation: 3241

You can try alternate paths... that is not disposing a button but just hiding it. If you are using a GridLayout you can use GridData#exclude to ensure the button is hidden and its space is utilized by others.

Upvotes: 1

Related Questions