📄 myinfoframe.java
字号:
package com.king4solomon.homework.compiler.gui;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
@SuppressWarnings("serial")
public class MyInfoFrame extends JFrame implements ActionListener {
public MyInfoFrame() {
super("About Extended C0 Compiler");
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
Toolkit kit = Toolkit.getDefaultToolkit();
Dimension screenSize = kit.getScreenSize();
setSize(screenSize.width / 2 + 70, screenSize.height / 2);
setLocation(screenSize.width / 4, screenSize.height / 4);
Rectangle bound = new Rectangle(screenSize.width / 2 + 70,screenSize.height / 2);
bound.setLocation(screenSize.width / 4, screenSize.height / 4);
setMaximizedBounds(bound);
setLayout(new BorderLayout());
JPanel pane = new JPanel();
JLabel info = new JLabel();
info.setLayout(new BorderLayout());
info.setVerticalTextPosition(SwingConstants.NORTH);
info
.setText("<html><br><br>"
+ "<p><font size=\"4\" type=\"bold\"> Extended C0 Comipler</font></p>"
+ "<br>"
+ " Author: Xuxt No.34060520"
+ "<br>"
+ " Version: 1.1.0"
+ "<br>"
+ " Build id: 20070401-1.1.0"
+ "<br><br>"
+ " (c) Copyright Xuxt@buaa 2007. All rights reserved."
+ "<br>"
+ " Email: "
+ "<A href='xuxt@act.buaa.edu.cn'>xuxt@act.buaa.edu.cn</A>"
+ "<br><br>"
+ " This product is developed using the following:"
+ "<br>"
+ " J2SE JDK1.5.06: "
+ "<A href='http://www.java.com'>http://www.java.com/</A>"
+ "<br>"
+ " Eclipse Foundation: "
+ "<A href='http://www.eclipse.org'>http://www.eclipse.org/</A>"
+ "<br><br><br><br><br></html>");
info.setBorder(BorderFactory.createRaisedBevelBorder());
info.setPreferredSize(new Dimension(350,300));
JButton bt = new JButton("OK");
bt.addActionListener(this);
pane.add(info, BorderLayout.NORTH);
pane.add(bt, BorderLayout.SOUTH);
JLabel warLock = new JLabel(new ImageIcon("images/2s.jpg"));
warLock.setBorder(BorderFactory.createLoweredBevelBorder());
warLock.setText("<html>"+"Here burns the fire of death..."+"<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>"+" Xuxt@buaa"+"</html>");
warLock.setFont(new Font("",Font.ITALIC,14));
warLock.setForeground(Color.LIGHT_GRAY);
warLock.setVerticalTextPosition(SwingConstants.CENTER);
warLock.setHorizontalTextPosition(SwingConstants.CENTER);
warLock.setVisible(true);
add(warLock, BorderLayout.WEST);
add(pane, BorderLayout.CENTER);
setVisible(true);
}
public void actionPerformed(ActionEvent e) {
dispose();
}
public static void main(String args[]) {
new MyInfoFrame();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -