Hi all, I'm newb & I know it. Stuck at some trouble doing my learning activities. The task is, find out whether the given string is a palindrome. All but one work fine.
The problem is: the main window's opened, I put the string into, then press "Check" and an answer window opens. Then I press OK in the answer window. And if I try to put another string into the main window and press Check again - the whole thing crashes. I have to close it and start again if I wanna reuse it. So I think I got a dumb piece of code somewhere in my program. What's the hitch?
(PS sry for poor Eng, it's not my mt)

Exception in thread "main" org.eclipse.swt.SWTException: Widget is disposed
at org.eclipse.swt.SWT.error(SWT.java:4361)
at org.eclipse.swt.SWT.error(SWT.java:4276)
at org.eclipse.swt.SWT.error(SWT.java:4247)
at org.eclipse.swt.widgets.Widget.error(Widget.java:4 80)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget. java:417)
at org.eclipse.swt.widgets.Label.setText(Label.java:5 71)
at PalindromeCheck$2.handleEvent(PalindromeCheck.java :56)
at org.eclipse.swt.widgets.EventTable.sendEvent(Event Table.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.ja va:1276)
at org.eclipse.swt.widgets.Display.runDeferredEvents( Display.java:3554)
at org.eclipse.swt.widgets.Display.readAndDispatch(Di splay.java:3179)
at PalindromeCheck.main(PalindromeCheck.java:67)

The code uses 3rd party packages and classes which will reduce the number of people that can compile and execute the code for testing.

April 13th, 2013, 06:58 AM

Scampada

Re: "Widget is disposed" LMDE

Aw. Yeah. I didn't noticed the formatting was lost. And in the "Ask a question" form were not formatting buttons. Now trying to get the "Edit post" link working... Waiting for 5 minutes and no reaction from it

April 13th, 2013, 07:02 AM

Norm

Re: "Widget is disposed" LMDE

Could be some restriction for new posters. Many OPs just post again with the code tags. I've added code tags.

However that did not fix the formatting. The nested statement need to be indented. Too many start in the first column.

April 13th, 2013, 11:14 AM

Scampada

Re: "Widget is disposed" LMDE

I bothered to nested statement in my code. Now I can't see it - maybe it's awaiting moderator's acknowledge. Does it look better now?

April 13th, 2013, 11:29 AM

Norm

Re: "Widget is disposed" LMDE

The formatting is better now.

Is there a forum for the org.eclipse.swt.widgets packages? I haven't seen them discussed on this forum.

April 13th, 2013, 12:59 PM

Scampada

Re: "Widget is disposed" LMDE

Well, I googled again and found some eclipse.org forum branch dedicated for SWT only. I've duplicated the topic, and will be waiting for responses both here and there)

April 13th, 2013, 03:13 PM

jps

Re: "Widget is disposed" LMDE

Quote:

Originally Posted by Scampada

I've duplicated the topic, and will be waiting for responses both here and there)

Where? If you cross post on another forum, please leave a link to it so everyone can see the same thing.

April 13th, 2013, 03:40 PM

Scampada

Re: "Widget is disposed" LMDE

Weeell... I haven't duplicated the whole post... I just left there a link to this topic with some brief explanations. I've told them I didn't want to format it twice. Maybe it'd be even better to upload this dumb piece of code to github eh? Heh heh.