File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

No use of EDT in SCJD book?

 
Norbert Lebenthal
Ranch Hand
Posts: 74
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I'm all new to Swing, but from what I got of it one should care of rightly using the EDT.

However, the SCJD book hardly speaks of it. Is the SCJD some case of special use case where using the EDT could be avoided ?

best
norbert
 
Roel De Nijs
Sheriff
Posts: 9137
75
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Norbert,

First of all, EDT = Event Dispatch Thread (for those who don't know the abbreviation).

Secondly the GUI you need to create for this assignment is quiet simple and limited, I didn't have used it in my assignment as far as I know, so that's why it's not (or hardly) mentioned in the book.

Kind regards,
Roel
 
David Byron
Rancher
Posts: 172
Clojure Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another way to look at it: user gestures passed through the OS already reach your event listeners on the EDT, so updates to the GUI from within those listeners already tacitly run in the right place.

Depending on your implementation details, you might need to update the GUI by passing a runnable into a SwingUtilities method for later invocation.
 
Norbert Lebenthal
Ranch Hand
Posts: 74
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in the end I'm clueless about the EDT, apart having heard of it, so details like the ones from David Byron are a bit obscure to me.

if the certif can be obtain without taking specific care of the EDT, all the better then. I'm a bit surprised though because not taking care of the EDT is normally a recipe for disaster in bigger applications (once again, from what I read), from slow perf to randow multithreading issues.

AFAIK, the substance L&F (https://substance.dev.java.net/) even takes extra steps to make sure the user doesn't do too much crap. If I was to properly implement the EDT, I would dig into their recommendations.
 
Roel De Nijs
Sheriff
Posts: 9137
75
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had a look into my GUI-code, no references at all to SwingUtilities. Like I already said before: the GUI is very simple and limited, so it makes no sense to compare with fully-fledged professional desktop applications.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic