[CODE]public class Example { private static void createAndShowGUI() { JFrame.setDefaultLookAndFeelDecorated(true); JFrame frame = new JFrame("Window"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JLabel emptyLabel = new JLabel(""); emptyLabel.setPreferredSize(new Dimension(175, 100)); frame.getContentPane().add(emptyLabel, BorderLayout.CENTER); frame.pack(); frame.setVisible(true); } public static void main(String[] args) { javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { createAndShowGUI(); } }); } }[/CODE] In The above code, what is the technical name for [CODE] javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { createAndShowGUI(); } });[/CODE] in the main method.

Member Avatar
Member Avatar
+0 forum 7

I want to make a GUI application in which I want to do something continuously (i.e. in while loop) in a different thread, until the user presses a button. In this other thread, I am accessing GUI elements and hence I have to use [B]SwingUtilities.invokeLater()[/B] for this thread. But since this thread never ends, the Event Dispatching Thread's event handler for the button would never be called. How to handle this situation ?

Member Avatar
Member Avatar
+0 forum 13

The End.