Here you can find the source of setPressedColumn(JTableHeader tableHeader, int columnModelIndex)
Parameter | Description |
---|---|
tableHeader | the JTableHeader to set the pressed state for. |
columnModelIndex | the column model index of the pressed column. |
public static void setPressedColumn(JTableHeader tableHeader, int columnModelIndex)
//package com.java2s; //License from project: Open Source License import javax.swing.table.JTableHeader; public class Main { private static final String PRESSED_COLUMN_KEY = "EPJTableHeader.pressedColumn"; /**/*from www.j av a 2s . com*/ * Sets the given column for the given {@link JTableHeader} as pressed. Calling this method * installs a hint, which can be used by renders to draw the correct column pressed state. * Renders can use {@link #isColumnPressed(javax.swing.table.JTableHeader, int)} to determine * what state to draw the header for the given index in. * header state. * * @param tableHeader the {@code JTableHeader} to set the pressed state for. * @param columnModelIndex the column model index of the pressed column. */ public static void setPressedColumn(JTableHeader tableHeader, int columnModelIndex) { tableHeader.putClientProperty(PRESSED_COLUMN_KEY, columnModelIndex); } }