I am developing a Swing application that checks the stock level at a pre-defined interval. To check the stock level at a pre-defined interval, what should I use. Can I use a Thread that runs till the app shuts down?
When working with Mult-Threading inside Swing be aware of it even dispatching mechanism. Swing components need to be accessed via the event dispatching thread. So the lengthy tasks should not occur in the event dispatching thread because this will hold up the dispatcher thread. Check invokeLater() and invokeAndWait() methods.