📄 logo.java
字号:
//import the packages for using the classes in them into the program
import java.awt.*;
import javax.swing.*;
/**
*A public class
*/
public class Logo extends JWindow {
//constructor of Logo
public Logo() {
//for creating the panel
JPanel panel =
new JPanel() {
//for painting the component
public void paintComponent(Graphics g) {
//for getting the image
ImageIcon img = new ImageIcon(ClassLoader.getSystemResource("images/Logo.JPG"));
//for drawing the image
g.drawImage(img.getImage(), 0, 0, null);
super.paintComponent(g);
}
};
panel.setOpaque(false);
//for setting the border
panel.setBorder(BorderFactory.createEtchedBorder());
//for setting the panel in the contentPane
setContentPane(panel);
//for setting the ContentPane to true
//for setting the background
panel.setBackground(Color.black);
//for setting the size
setSize(350,250);
/****************************************
*for setting the program in the center *
*@see center.java *
****************************************/
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
setLocation((screenSize.width - getSize().width)/2,(screenSize.height-getSize().height) / 2);
setVisible(true);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -