Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. package myProject;
  2.  
  3. import java.awt.event.ActionEvent;
  4. import java.awt.event.ActionListener;
  5. import java.util.Timer;
  6. import java.util.logging.Level;
  7. import java.util.logging.Logger;
  8.  
  9.  
  10. public class Splash extends javax.swing.JFrame {
  11.  
  12. public Splash() {
  13. initComponents();
  14. }
  15.  
  16. public static void main(String args[]) {
  17. [...default code ...]
  18. }
  19. //</editor-fold>
  20. /* Create and display the form */
  21. java.awt.EventQueue.invokeLater(new Runnable() {
  22. public void run() {
  23. new Splash().setVisible(true);
  24. }
  25. });
  26.  
  27. // code I'm trying to run when the window shows
  28. new java.util.Timer().schedule(
  29. new java.util.TimerTask() {
  30. @Override
  31. public void run() {
  32.  
  33. // show the next window
  34. WindowShow Show = new WindowShow();
  35. Show.setVisible(true);
  36.  
  37. // hide this window, DOESN'T WORK
  38. this.setVisible(false);
  39.  
  40. }
  41. },
  42. 5000
  43. );
  44. }
  45.  
  46.  
  47.  
  48. // Variables declaration - do not modify
  49. private javax.swing.JButton jButton1;
  50. private javax.swing.JLabel jLabel1;
  51. // End of variables declaration
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement