2 Topics

Member Avatar for
Member Avatar for FALL3N

[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 …

Member Avatar for FALL3N
0
196
Member Avatar for daudiam

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 …

Member Avatar for daudiam
0
1K

The End.