package com.dreikraft.swing; import java.net.URL; import javax.swing.ImageIcon; /** * SplashScreen. * @author jan.illetschko@3kraft.com */ public class SplashScreen extends javax.swing.JWindow { private URL imageURL; private boolean resize; /** Creates new form BeanForm */ public SplashScreen() { initComponents(); } public URL getImageURL() { return imageURL; } public void setImageURL(URL imageURL) { this.imageURL = imageURL; ImageIcon icon = new ImageIcon(imageURL); this.splashLabel.setIcon(icon); this.splashLabel.setSize(icon.getIconWidth(), icon.getIconHeight()); this.pack(); } public boolean isResize() { return resize; } public void setResize(boolean resize) { this.resize = resize; } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { splashLabel = new javax.swing.JLabel(); splashLabel.setToolTipText(""); splashLabel.setDoubleBuffered(true); splashLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { splashLabelMouseClicked(evt); } }); getContentPane().add(splashLabel, java.awt.BorderLayout.CENTER); }// </editor-fold>//GEN-END:initComponents private void splashLabelMouseClicked(java.awt.event.MouseEvent evt)//GEN-FIRST:event_splashLabelMouseClicked {//GEN-HEADEREND:event_splashLabelMouseClicked this.dispose(); }//GEN-LAST:event_splashLabelMouseClicked // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel splashLabel; // End of variables declaration//GEN-END:variables }