Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Swing Worker?

 
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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
 
I guess I've been abducted by space aliens. So unprofessional. They tried to probe me with this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic