欢迎来到虫虫下载站 | 资源下载 资源专辑 关于我们
虫虫下载站

jtool.java

管理系统实现的源代码,
JAVA
字号:
package 学生成绩管理系统;import java.sql.ResultSet;import javax.swing.*;import java.awt.*;import java.awt.event.*;import java.sql.SQLException;import javax.swing.JOptionPane;public class JTool        extends JButton        implements MouseListener {    private ResultSet rs;    public JTool(String picName, String text, String toolTip) {        buildButton0(picName, text, toolTip, false);    }    public JTool(String picName, String text, String toolTip, boolean flag) {        buildButton0(picName, text, toolTip, flag);    }    private void buildButton0(String picName, String text, String toolTip, boolean flag) {        this.setIcon(new ImageIcon(picName));        this.setText(text);        this.setToolTipText(toolTip);        this.setBorderPainted(true);        if (flag) {            this.setContentAreaFilled(false);		//设置背景色透明            this.setHorizontalTextPosition(SwingConstants.CENTER);            this.setVerticalTextPosition(SwingConstants.BOTTOM);        }        this.addMouseListener(this);    }    public void mouseClicked(MouseEvent me) {       // JOptionPane.showMessageDialog(null, "该功能正在完善中...");    }    public void mousePressed(MouseEvent me) {        if (me.getSource() == MainFrame.m1) {            MainFrame.h.setVisible(true);        }        if (me.getSource() == MainFrame.m2) {            MainFrame.s.setVisible(true);        }            if (me.getSource() == MainFrame.m3) {           System.exit(1);        }    }    public void mouseReleased(MouseEvent me) {    }    public void mouseEntered(MouseEvent me) {        this.setForeground(new Color(156, 126, 66));        this.setBackground(new Color(234, 223, 203));    }    public void mouseExited(MouseEvent me) {        this.setForeground(new Color(87, 87, 47));        this.setBackground(new Color(231, 215, 183));    }}

⌨️ 快捷键说明

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