Spring Boot + Java Swing
Hi, I’m currently working on a Swing project where I want to integrate Spring Boot for DI and JDBC. So, I want to take advantage of dependency injection for creating swing components. But, I’m encountering a problem because Swing Initialization must run in Event Dispatch Thread (EDT), and I don’t know how to tell Spring to instantiate swing components on EDT.
I’ve been thinking in something like this:
SwingUtilities.invokeLater(() -> SpringApplication.run(Main.class, args));
But, I don’t know if it would be right to initiate the spring context container on EDT.
How can I solve this?
Any ideas are welcome, thanks!
Bragg is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.