⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 about.java

📁 别人的代码
💻 JAVA
字号:
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.util.*;
public class About extends JDialog{
	JLabel label;
	JPanel panel;
	JTextArea ta;
	JScrollPane sp;
	String s1,s2;
	JButton button;
	Container contentPane;
	public About(JFrame parent){
		super(parent,"About...");
		init();
	}
	public void init(){
		s1="javaants 1.0";
		s2="          Welcome to use javaants1.0!";
		contentPane=getContentPane();
		button=new JButton("OK");
		button.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				dispose();
			}
		});
		label=new JLabel(s1);
		panel=new JPanel();
		panel.add(label);
		ta=new JTextArea(10,8);
		ta.setEditable(false);
		ta.setText(s2);
		sp=new JScrollPane(ta);
		contentPane.add(panel,BorderLayout.NORTH);
		contentPane.add(sp,BorderLayout.CENTER);
		contentPane.add(button,BorderLayout.SOUTH);
	}
	public void center(){
		Dimension screenSize,size;
		screenSize=Toolkit.getDefaultToolkit().getScreenSize();
		size=this.getSize();
		if(size.height > screenSize.height){
           size.height=screenSize.height;
        }
        if(size.width >screenSize.width){
           size.width=screenSize.width;
        }
        this.setLocation((screenSize.width - size.width)/2,
           (screenSize.height - size.height)/2);
    }
	
}

⌨️ 快捷键说明

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