引用页_初学Java:仿写记事本_MenuAbout.java

<< 返回
  

import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;

import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;

@SuppressWarnings("serial")
public class MenuAbout extends JDialog implements WindowListener{
	private JTabbedPane tab = null;
	private JTextArea textArea = null;
	private JScrollPane scrollPane = null;
	private JPanel panel = null;
	private JLabel version = null;
	private JLabel author = null;
	public MenuAbout() {
		this.tab = new JTabbedPane();
		this.textArea = new JTextArea();
		this.scrollPane = new JScrollPane(this.textArea, 
				JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,//始终显示垂直滚动条
				JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);//仅在需要的时候显示水平滚动条
		this.panel = new JPanel();
		
		this.version = new JLabel("Notepad Alpha 1.0 (2012.3.22) ");
		this.author = new JLabel("Tieper");
		
		this.panel.add(this.version);
		this.panel.add(this.author);
		
		this.textArea.setEditable(false);	//不可编辑
		this.textArea.setLineWrap(true);	//自动换行
		this.textArea.setText("Tieper\nhttp://blog.csdn.net/tieper/article/details/7384333");
		tab.addTab("版权与作者", this.panel);
		tab.addTab("程序说明", this.scrollPane);
		
		this.add(this.tab);
		this.setTitle("关于 \"记事本\"");
		this.setSize(400, 300);
		this.setLocation(300, 200);
		this.setResizable(false);
		this.setIconImage(null);
		
		this.setVisible(true);
	}
	@Override
	public void windowActivated(WindowEvent arg0) {}
	@Override
	public void windowClosed(WindowEvent arg0) {}
	@Override
	public void windowClosing(WindowEvent arg0) {
		this.dispose();
	}
	@Override
	public void windowDeactivated(WindowEvent arg0) {}
	@Override
	public void windowDeiconified(WindowEvent arg0) {}
	@Override
	public void windowIconified(WindowEvent arg0) {}
	@Override
	public void windowOpened(WindowEvent arg0) {}
}
  
<< 返回

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值