I created a GUI class and a demo class.
the demo class is calling to the GUI. I would like to run the GUI in a different thread.
GUI Class
public class UserGui extends JFrame {
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
UserGui frame = new UserGui();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
}
Demo Class:
public class NNDemo {
public static void main(String[] args) {
UserGui gui = new UserGui();
gui.setVisible(true);
}
}
1 Answer