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

📄 about.java

📁 用java写的浏览器的服务器和客户端程序
💻 JAVA
字号:
/**
 * Email: taorundong@126.com
 *
 * @author taorundong
 * @version 1.00 07/02/03
 */
 
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.net.URL;

public class About extends JFrame implements ActionListener{
	
	private
	JButton sure = null;
	JPanel button = null;
	JLabel label = null;
	JTextArea text = null;
	JPanel slip = null;
	String s = null;
	URL url = null;

	
	About(String title){
		super(title);
		
		button = new JPanel();
		sure = new JButton("OK");
		label = new JLabel();
		text = new JTextArea();
		slip = new JPanel(new GridLayout(1,2));
		
		setScreenSize();
		setVisible(true);
		showSlip();
		showButton();
	}
	
	
	public void showSlip(){
		
		try{
			url = this.getClass().getResource("picture\\2.jpg");
		}
		catch(Exception e){
			e.printStackTrace();
		}
		
		label.setIcon(new ImageIcon(this.getToolkit().getImage(url)));
		text.append("\nCopyright  :Frenzy \n Email: \n      taorundong@126.com");
		text.setBackground(Color.green);
		text.setEditable(false);
		slip.add(label);
		slip.add(text);
		slip.validate();
		
		Container con = this.getContentPane();
		con.add(slip,"Center");
		con.validate();
		
	}
	
	
	public void showButton(){
		
		FlowLayout flow = new FlowLayout();
		flow.setAlignment(FlowLayout.CENTER);
		button.setBackground(Color.yellow);
		button.setLayout(flow);
		button.add(sure);
		
		Container con = this.getContentPane();
		con.add(button,"South");
		sure.addActionListener(this);
		con.validate();
	}
	
	
	public void setString(String temp){
		s = temp;
	}


	public String returnString(){
		return s;
	}
	
	
	public void setScreenSize(){
		Dimension screen = this.getToolkit().getScreenSize();
		this.setBounds((screen.width/2-150),(screen.height/2-100),300,200);
		this.setResizable(false);
		this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		this.setIconImage(this.getToolkit().getImage("picture\\11.gif"));
	}
	
	
	public void actionPerformed(ActionEvent e){
		if(e.getSource()==sure){
			this.dispose();
		}
	}
	
	
}

⌨️ 快捷键说明

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