?? progressrenderer.java
字號:
/* * @(#) ProgressRenderer.java * Copyright 2004 HWStudio. All rights reserved. */package hws.item.smart.utility.share;//導入核心Java類庫import java.awt.Component;import javax.swing.JTable;import javax.swing.JProgressBar;import javax.swing.table.TableCellRenderer;/** * This class renders a JProgressBar in a table cell * * @version 0.1 2005-08-30 * @author Hwerz */public class ProgressRenderer extends JProgressBar implements TableCellRenderer { /*------------------------------------------------------------------------* * 構造函數 * *------------------------------------------------------------------------*/ /** * Create a new instance of this class * * @param min the minimum value of the progress bar * @param max the maximum value of the progress bar */ public ProgressRenderer(int min, int max) { super(min, max); setStringPainted(true); } /*------------------------------------------------------------------------* * 實現方法 * *------------------------------------------------------------------------*/ /** * 實現接口TableCellRenderer的方法 * * @param table the JTable that is asking the renderer to draw; can be null * @param value the value of the cell to be rendered * @param isSelected true if the cell is to be rendered with the selection * highlighted; otherwise false * @param hasFocus if true, render cell appropriately * @param row the row index of the cell being drawn * @param column the column index of the cell being drawn * @return this JProgressBar as the renderer for the given table cell */ public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { setValue(Integer.parseInt(value.toString())); return this; }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -