Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. package gui;
  2.  
  3.  
  4. import javax.swing.JFrame;
  5. import javax.swing.JPanel;
  6.  
  7. public class MainScreen extends JFrame
  8. {
  9. public MainScreen() throws IOException
  10. {
  11. ....
  12. this.pack();
  13. this.setVisible(true);
  14. }
  15. }
  16.  
  17. public static void main(String[] args)
  18. {
  19. //avoid blocking the main thread
  20. SwingUtilities.invokeLater(new Runnable(){
  21. @Override
  22. public void run() {
  23.  
  24. try {
  25.  
  26. new MainScreen();
  27. } catch (IOException e) {
  28. e.printStackTrace();
  29. };
  30. }
  31. });
  32.  
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement