📄 framemain_aboutbox.java
字号:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
public class FrameMain_AboutBox extends JDialog implements ActionListener {
ImageIcon img=new ImageIcon("a.jpg");
String product = "search engine";
String version = "1.0";
Panel pnlSouth = new Panel();
FlowLayout flowLayout1 = new FlowLayout();
Panel pnlCenter = new Panel();
Panel pnlNorth = new Panel();
JLabel jlblTitle = new JLabel();
JLabel jLabel1 = new JLabel();
JLabel jLabel2 = new JLabel();
JLabel jLabel3 = new JLabel();
JLabel jLabel4 = new JLabel();
JLabel jLabel5 = new JLabel();
JButton jButton1 = new JButton();
JLabel jLabel6 = new JLabel();
JLabel jLabel7 = new JLabel();
JLabel jLabel8 = new JLabel();
public FrameMain_AboutBox(Frame parent) {
super(parent);
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
setSize(420,300);
}
/**Component initialization*/
private void jbInit() throws Exception {
//imageLabel.setIcon(new ImageIcon(FrameMain_AboutBox.class.getResource("osi.gif")));
this.setTitle("About");
this.getContentPane().setBackground(SystemColor.controlHighlight);
pnlSouth.setLayout(flowLayout1);
jlblTitle.setFont(new java.awt.Font("SansSerif", 1, 18));
jlblTitle.setForeground(new Color(238, 92, 79));
jlblTitle.setText("Java Search Engine v1.0");
pnlCenter.setLayout(null);
jLabel1.setDisplayedMnemonic('0');
jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
jlblTitle.setFont(new java.awt.Font("SansSerif", 1, 12));
jlblTitle.setForeground(new Color(238, 92, 79));
jlblTitle.setText("CMS COLLEGE OF SCIENCE AND COMMERCE,COIMBATORE ");
pnlCenter.setLayout(null);
jLabel1.setDisplayedMnemonic('0');
jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
// jLabel1.setText("Search Engine VER 1.0");
jLabel1.setVerticalAlignment(SwingConstants.TOP);
jLabel1.setBounds(new Rectangle(138, 161, 128, 17));
/*jLabel2.setText("Copy Right 2004");
jLabel2.setBounds(new Rectangle(158, 39, 96, 17));
jLabel3.setText("AUTHOR:");
jLabel3.setBounds(new Rectangle(71, 131, 66, 20));
jLabel4.setText("Siba Prasad Patro");
jLabel4.setBounds(new Rectangle(67, 164, 117, 18));
jLabel5.setText("01/UCE/228");
jLabel5.setBounds(new Rectangle(69, 190, 81, 18));
jButton1.setFont(new java.awt.Font("Dialog", 1, 12));*/
jButton1.setBorder(BorderFactory.createEtchedBorder());
//jButton1.setToolTipText("Click 'OK' to cancel");
jButton1.setMargin(new Insets(10, 14, 10, 14));
jButton1.setText(" OK ");
jButton1.addActionListener(this);
jButton1.requestFocus();
jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(MouseEvent e) {
jButton1_mouseClicked(e);
}
});
/*jLabel6.setText("Customer:");
jLabel6.setBounds(new Rectangle(230, 131, 144, 18));
//jLabel7.setText("U.C.E.Burla");
jLabel7.setBounds(new Rectangle(233, 164, 117, 18));*/
jLabel8.setBorder(BorderFactory.createEtchedBorder());
jLabel8.setOpaque(true);
jLabel8.setIcon(img);
jLabel8.setBounds(new Rectangle(130, 41, 140, 170));
this.getContentPane().add(pnlSouth, BorderLayout.SOUTH);
pnlSouth.add(jButton1, null);
this.getContentPane().add(pnlNorth, BorderLayout.NORTH);
pnlNorth.add(jlblTitle, null);
this.getContentPane().add(pnlCenter, BorderLayout.CENTER);
pnlCenter.add(jLabel4, null);
pnlCenter.add(jLabel5, null);
pnlCenter.add(jLabel6, null);
pnlCenter.add(jLabel7, null);
pnlCenter.add(jLabel3, null);
pnlCenter.add(jLabel1, null);
pnlCenter.add(jLabel2, null);
pnlCenter.add(jLabel8, null);
}
/**Overridden so we can exit when window is closed*/
protected void processWindowEvent(WindowEvent e) {
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
cancel();
}
super.processWindowEvent(e);
}
/**Close the dialog*/
void cancel() {
dispose();
}
/**Close the dialog on a button event*/
public void actionPerformed(ActionEvent e) {
if (e.getSource() == jButton1) {
cancel();
}
}
void jButton1_mouseClicked(MouseEvent e) {
cancel();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -