📄 jimsplashscreen.java
字号:
package jim;
import java.awt.*;
import javax.swing.*;
/* Copyright, 2001 Jason Dominiczak.
*
* This file is part of JIM - The Java Instant Messenger.
* eMailer is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
* JIM is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with eMailer; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*/
public class JimSplashScreen extends JWindow {
IvjEventHandler ivjEventHandler = new IvjEventHandler();
private JLabel ivjJLabel1 = null;
private JPanel ivjJWindowContentPane = null;
class IvjEventHandler implements java.awt.event.WindowListener {
public void windowActivated(java.awt.event.WindowEvent e) {};
public void windowClosed(java.awt.event.WindowEvent e) {};
public void windowClosing(java.awt.event.WindowEvent e) {
if (e.getSource() == JimSplashScreen.this)
connEtoC1(e);
};
public void windowDeactivated(java.awt.event.WindowEvent e) {};
public void windowDeiconified(java.awt.event.WindowEvent e) {};
public void windowIconified(java.awt.event.WindowEvent e) {};
public void windowOpened(java.awt.event.WindowEvent e) {};
};
/**
* JimSplashScreen constructor comment.
*/
public JimSplashScreen() {
super();
initialize();
}
/**
* JimSplashScreen constructor comment.
* @param owner java.awt.Frame
*/
public JimSplashScreen(Frame owner) {
super(owner);
}
/**
* JimSplashScreen constructor comment.
* @param owner java.awt.Window
*/
public JimSplashScreen(Window owner) {
super(owner);
}
/**
* connEtoC1: (JimSplashScreen.window.windowClosing(java.awt.event.WindowEvent) --> JimSplashScreen.dispose()V)
* @param arg1 java.awt.event.WindowEvent
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void connEtoC1(java.awt.event.WindowEvent arg1) {
try {
// user code begin {1}
// user code end
this.dispose();
// user code begin {2}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {3}
// user code end
handleException(ivjExc);
}
}
/**
* Return the JLabel1 property value.
* @return javax.swing.JLabel
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JLabel getJLabel1() {
if (ivjJLabel1 == null) {
try {
ivjJLabel1 = new javax.swing.JLabel();
ivjJLabel1.setName("JLabel1");
ivjJLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/splashscreen.gif")));
ivjJLabel1.setText("");
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjJLabel1;
}
/**
* Return the JWindowContentPane property value.
* @return javax.swing.JPanel
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JPanel getJWindowContentPane() {
if (ivjJWindowContentPane == null) {
try {
ivjJWindowContentPane = new javax.swing.JPanel();
ivjJWindowContentPane.setName("JWindowContentPane");
ivjJWindowContentPane.setBorder(new javax.swing.border.EtchedBorder());
ivjJWindowContentPane.setLayout(new java.awt.BorderLayout());
getJWindowContentPane().add(getJLabel1(), "Center");
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjJWindowContentPane;
}
/**
* Called whenever the part throws an exception.
* @param exception java.lang.Throwable
*/
private void handleException(java.lang.Throwable exception) {
/* Uncomment the following lines to print uncaught exceptions to stdout */
// System.out.println("--------- UNCAUGHT EXCEPTION ---------");
// exception.printStackTrace(System.out);
}
/**
* Initializes connections
* @exception java.lang.Exception The exception description.
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void initConnections() throws java.lang.Exception {
// user code begin {1}
// user code end
this.addWindowListener(ivjEventHandler);
}
/**
* Initialize the class.
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void initialize() {
try {
// user code begin {1}
// user code end
setName("JimSplashScreen");
setSize(300, 220);
setContentPane(getJWindowContentPane());
initConnections();
} catch (java.lang.Throwable ivjExc) {
handleException(ivjExc);
}
// user code begin {2}
// user code end
}
/**
* main entrypoint - starts the part when it is run as an application
* @param args java.lang.String[]
*/
public static void main(java.lang.String[] args) {
try {
JimSplashScreen aJimSplashScreen;
aJimSplashScreen = new JimSplashScreen();
aJimSplashScreen.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent e) {
System.exit(0);
};
});
aJimSplashScreen.show();
java.awt.Insets insets = aJimSplashScreen.getInsets();
aJimSplashScreen.setSize(aJimSplashScreen.getWidth() + insets.left + insets.right, aJimSplashScreen.getHeight() + insets.top + insets.bottom);
aJimSplashScreen.setVisible(true);
} catch (Throwable exception) {
System.err.println("Exception occurred in main() of javax.swing.JWindow");
exception.printStackTrace(System.out);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -