Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package myProject;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.util.Timer;
- import java.util.logging.Level;
- import java.util.logging.Logger;
- public class Splash extends javax.swing.JFrame {
- public Splash() {
- initComponents();
- }
- public static void main(String args[]) {
- [...default code ...]
- }
- //</editor-fold>
- /* Create and display the form */
- java.awt.EventQueue.invokeLater(new Runnable() {
- public void run() {
- new Splash().setVisible(true);
- }
- });
- // code I'm trying to run when the window shows
- new java.util.Timer().schedule(
- new java.util.TimerTask() {
- @Override
- public void run() {
- // show the next window
- WindowShow Show = new WindowShow();
- Show.setVisible(true);
- // hide this window, DOESN'T WORK
- this.setVisible(false);
- }
- },
- 5000
- );
- }
- // Variables declaration - do not modify
- private javax.swing.JButton jButton1;
- private javax.swing.JLabel jLabel1;
- // End of variables declaration
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement