?? tjlist.java
字號:
/**
*##############################################################################
*
* [ 項目名 ] :
* [ 公司名 ] : SunshineSOFT
* [ 模塊名 ] : 帶監(jiān)聽的JList列表框
* [ 文件名 ] : TJList.java
* [ 相關(guān)文件 ] :
* [ 文件實現(xiàn)功能] : 帶監(jiān)聽的文本區(qū)域
* [ 作者 ] : 顧俊
* [ 版本 ] : 1.0
* ----------------------------------------------------------------------------
* [ 備注 ] :
* ----------------------------------------------------------------------------
* [ 修改記錄 ] :
*
* [ 日 期 ] [版本] [修改人] [修改內(nèi)容]
* 2006/04/25 1.0 顧俊 創(chuàng)建
* ##--------------------------------------------------------------------------
* 版權(quán)所有(c) 2006-2007, SunshineSOFT Corporation
* --------------------------------------------------------------------------##
*
* [ 函數(shù)說明 ] :
*
* [## public TJList() {} ]:
* 功能: 構(gòu)造函數(shù)
*
* [ 遺留問題 ] :
*
*##############################################################################
*/
package com.sunshine.sunsdk.swing;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class TJList
extends JList
implements MouseListener {
public TJList() {
//設(shè)置顯示的行數(shù)
this.setVisibleRowCount(5);
//設(shè)置前景色和后景色
this.setForeground(new Color(141, 131, 106));
this.setBackground(new Color(244, 238, 227));
//加鼠標監(jiān)聽
this.addMouseListener(this);
}
/**=======================================================================**
* MouseListener 監(jiān)聽
**=======================================================================**
*/
public void mouseClicked (MouseEvent me) {
}
public void mousePressed (MouseEvent me) {
}
public void mouseReleased(MouseEvent me) {
}
public void mouseEntered (MouseEvent me) {
this.setForeground(new Color( 87, 87, 47));
this.setBackground(new Color(248, 242, 230));
}
public void mouseExited (MouseEvent me) {
this.setForeground(new Color(141, 131, 106));
this.setBackground(new Color(244, 238, 227));
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -