开发者

Why do I need Swing Utilities and how do I use it?

开发者 https://www.devze.com 2023-03-13 07:53 出处:网络
This is mainly in regards to my questi开发者_运维问答on here, but I don\'t understand why Swing Utilities is needed and what it is used for.I\'m designing a swing gui and I don\'t wanna miss out on an

This is mainly in regards to my questi开发者_运维问答on here, but I don't understand why Swing Utilities is needed and what it is used for. I'm designing a swing gui and I don't wanna miss out on anything that Swing Utilities might offer. Also could someone could explain what the invokeLater method does and how it works.


As stated in the API, SwingUtilities is a collection of utility methods for Swing. In this case, it is needed to ensure that Swing components are created/modified in the Event Dispatch Thread, or EDT. Also, as stated in the API, invokeLater is used when an application thread needs to update the GUI.

You might also want to read up on Concurrency in Swing. Also, a More In-Depth Explanation of invokeLater.

0

精彩评论

暂无评论...
验证码 换一张
取 消