public Component getTableCellRendererComponent(
        JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
      if (table != null) {
        JTableHeader header = table.getTableHeader();
        if (header != null) {
          setFont(header.getFont());
        }
      }
      this.isSelected = isSelected;
      this.hasFocus = hasFocus;
      this.column = column;
      this.hasRollover = (column == rolloverColumn);
      if (skin == null || skin.getContentMargin() == null) {
        skin = XPStyle.getXP().getSkin(header, "header.headeritem");
      }
      setText((value == null) ? "" : value.toString());
      setBorder(new EmptyBorder(skin.getContentMargin()));

      return this;
    }
Пример #2
0
 public void allowSortColChange(boolean allow) {
   JTableHeader hdr = table.getTableHeader();
   if (allow && !allowSortColChange) hdr.addMouseListener(allowSortColChangeMouseListener);
   else if (!allow && allowSortColChange) hdr.removeMouseListener(allowSortColChangeMouseListener);
   allowSortColChange = allow;
 }