aboutframe.java

来自「SIMULATION FOURMILIERE -3D-ISOMETRIQUE」· Java 代码 · 共 44 行

JAVA
44
字号
package fr.umlv.fourmIR2000.frame;

import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;

final class AboutFrame {

	private AboutFrame() {
		/* nothing */
	}

	/**
	 * Create a new About frame
	 * @param parent	the parent of this frame
	 * @param title		the title of the window
	 */
	static void showAbout(final JFrame parent, final String title) {

		// Creation of the frame
		final JDialog f = new JDialog(parent, title, true);
		
		// SplashScreen
		try {
			final ImageIcon splash = new ImageIcon(ImageIO.read(AboutFrame.class.getResourceAsStream("/resources/pictures/splash.jpg")));
			final JLabel img = new JLabel(splash);
			img.setBounds(0, 0, splash.getIconWidth(), splash.getIconHeight());
			f.add(img);
			f.setSize(img.getSize());
			f.setResizable(false);

		} catch (IOException ioe) {
			ioe.printStackTrace();
		}
		
		f.setLocationRelativeTo(null);
		f.setVisible(true);
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?