Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Swing Worker?

 
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can we use the SwingWorker? It is not part of the JFC but is quite useful. Any suggestions?
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Never heard of it. What does it do?
And you can use anything you want as long as you feel you can justify it and defend it on your design.txt and essay exam.
Mark
 
Kalichar Rangantittu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A SwingWorker is a convinience tool put out on the sun site that helps do data intesive task and handle Swing Event queues convinittly. Forexample, if we had to do a database read of records, we would not like to execute that on the Event queue as it would create the blank screen effect. The way to do it, is run the task on a separate thread and then use the SwingUtitilies.invokeLater() to update the screen.
The SwingWorker does that for you:
public class MyWorker extends SwingWorker {
public Object construct() {
//Fethc rows...blah blah
return rows;
}

public void finished() {
Object rows = get();
table.update(rows);
}
}
The construct method will run on its own thread but will invoke the finished method on the event queue. I am however not sure if this is allowed for use
 
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I used, I just handed in my assignment. When I get a grade back, I'll let you know what happened.
@see
ME
[ January 31, 2002: Message edited by: Andre Mermegas ]
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kalichar,
I see no reason why you would loose marks if you use the SwingWorker class. The assignment spec says nothing about not using standard helper classes. Though I would document where you sourced it from. I plan to do this for my assignment. EG

Nick
 
What's gotten into you? Could it be this tiny ad?
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic