up 一下,现在总是只能设置整个column的tooltip,而不是单个cell的,在线等待!

解决方案 »

  1.   

    不支持就没有办法了,只能自己add了:if (point in cellRec) tipLabel.visiable = true~
      

  2.   

    我的思路是用JTable.getCellRenderer实现对于cell的引用,可是通过查询jdk的source如下:
        /**
         * Returns an appropriate renderer for the cell specified by this row and
         * column. If the <code>TableColumn</code> for this column has a non-null
         * renderer, returns that.  If not, finds the class of the data in
         * this column (using <code>getColumnClass</code>)
         * and returns the default renderer for this type of data.
         * <p>
         * <b>Note:</b>
         * Throughout the table package, the internal implementations always
         * use this method to provide renderers so that this default behavior
         * can be safely overridden by a subclass.
         *
         * @param row       the row of the cell to render, where 0 is the first row
         * @param column    the column of the cell to render,
         * where 0 is the first column
         * @return the assigned renderer; if <code>null</code>
         * returns the default renderer
         *  for this type of object
         * @see javax.swing.table.DefaultTableCellRenderer
         * @see javax.swing.table.TableColumn#setCellRenderer
         * @see #setDefaultRenderer
         */
        public TableCellRenderer getCellRenderer(int row, int column) {
            TableColumn tableColumn = getColumnModel().getColumn(column);
            TableCellRenderer renderer = tableColumn.getCellRenderer();
            if (renderer == null) {
                renderer = getDefaultRenderer(getColumnClass(column));
            }
            return renderer;
        }其中的row根本没有用到,所以得到的是column的引用,而不是cell的,不解。