public class FlushJob extends Job
public void actionPerformed(ActionEvent e)
{
// First step: close the current component (quick operation);
// this removes it from its container, so that the GUI is now empty.
closeCurrentComponent();
// Second step: flush events. At this point in the EventQueue there
// may be repaint events for the menu (or the button), and repaint events
// for the container (which should repaint an empty GUI, since the component
// has been removed in the previous step)
Worker.post(new FlushJob());
// After flushing the events, the user sees that the previous component
// has been removed (sees that the GUI is empty).
// Menus have been closed (or buttons repainted in non-pressed state),
// time to open the new component (lengthy operation).
loadComponent();
}
| Constructor and Description |
|---|
FlushJob() |
| Modifier and Type | Method and Description |
|---|---|
Object |
run()
The method to implement with time-consuming code.
|
getResultOrThrow, isCompletedpublic Object run()
JobCopyright © 2002-2011. All Rights Reserved.