Please join us at the new JavaWorld Q&A Forums. Your existing login will work there. The discussions here are now read-only.


JavaWorld Talkback >> 959003

Pages: 1
Anonymous
Unregistered




SWT on the client
      #7592 - 06/05/04 09:30 AM

Hi!

A few points about the article (which is excellent):

1) Use getClientArea() instead of hard coding pixel values
2) Common mistake: dispose() is not called recursively
- use the SWT.Dispose event intead to free resources
3) Use Display.beep() instead of the AWT beep
4) Dialog.open() is the naming convention, not show()

Keep up the great work. I have been using SWT on the client from very early days, porting an MFC app from C to Java. It is wonderful. Our users didn't know the new version was written in Java!

[censored]


Post Extras: Print Post   Remind Me!   Notify Moderator  
Gervase
Unregistered




Re: SWT on the client [Re: Anonymous]
      #7594 - 06/05/04 01:28 PM

Thanks,
you state
"2) Common mistake: dispose() is not called recursively
- use the SWT.Dispose event intead to free resources"

I am just wondering how this would work. There's an older article on handling resources issues at the Eclipse site
http://www.eclipse.org/articles/swt-design-2/swt-design-2.html

The recommendation is to add a disposeListener to each widget that utilizes and then invoke the resource's dispose() method with the widgetDisposed method.

This would be another approach to this issue rather than cleaning up iteratively in the code just before the display.dispose() .

Is this what you are suggesting?


Post Extras: Print Post   Remind Me!   Notify Moderator  
Anonymous
Unregistered




Re: SWT on the client [Re: Gervase]
      #7853 - 06/14/04 08:26 AM

What I am saying is that this statement is false:

"The Shell and its children are constructed such that when the application dies, each parent calls dispose() on its children."

The dispose() method is not actually called. If a subclass wants to dispose private resources when the the widget is disposed, it needs to listen for the dispose event, not override dispose().


Post Extras: Print Post   Remind Me!   Notify Moderator  
Anonymous
Unregistered




Re: SWT on the client [Re: Anonymous]
      #33835 - 07/05/06 10:24 AM

OH MY GAWD THIS SITE IS CRAP!!!!

Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 1 anonymous users are browsing this forum.

Moderator:   

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 8967

Rate this topic

Jump to

Contact us JavaWorld

Powered by UBB.threads™ 6.5.5