📄 about.java
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package com.redingsoft.about;import com.redingsoft.locationutil.LocationUtil;import com.redingsoft.sunsdk.swing.OJButton;import com.redingsoft.sunsdk.swing.setimage;import java.awt.BorderLayout;import java.awt.Color;import java.awt.Dimension;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.*;/** * * @author Administrator */public class About extends JDialog implements ActionListener{ //声明一个面板 JPanel jp1,jp2; //声明按钮 JButton bt1; public About (){ //实例化 jp1=new setimage("com/redingsoft/pic/about.gif"); jp2=new JPanel(); bt1=new JButton("关闭"); bt1.setContentAreaFilled(false); jp2.add(bt1); //设置面板 jp1.setBackground(Color.LIGHT_GRAY); jp2.setBackground(Color.LIGHT_GRAY); jp1.setPreferredSize(new Dimension(250,310)); // jp2.setPreferredSize(new Dimension(250,40)); //添加侦听 bt1.addActionListener(this); //添加到主窗口 this.add(BorderLayout.NORTH,jp1); this.add(BorderLayout.CENTER,jp2); this.setDefaultCloseOperation(About.DISPOSE_ON_CLOSE); this.setSize(275, 380); LocationUtil.setLocation(this); this.setTitle("关于redsoft"); // this.setVisible(true); } /********************8 public static void main(String [] aa){ new About(); }*########################*/ public void actionPerformed(ActionEvent e) { //throw new UnsupportedOperationException("Not supported yet."); if(e.getActionCommand().equals("关闭")){ this.dispose(); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -