本文整理汇总了Java中sun.swing.DefaultLookup.getIcon方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultLookup.getIcon方法的具体用法?Java DefaultLookup.getIcon怎么用?Java DefaultLookup.getIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.swing.DefaultLookup
的用法示例。
在下文中一共展示了DefaultLookup.getIcon方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTableCellRendererComponent
import sun.swing.DefaultLookup; //导入方法依赖的package包/类
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
Icon sortIcon = null;
boolean isPaintingForPrint = false;
if (table != null) {
JTableHeader header = table.getTableHeader();
if (header != null) {
Color fgColor = null;
Color bgColor = null;
if (hasFocus) {
fgColor = DefaultLookup.getColor(this, ui, "TableHeader.focusCellForeground");
bgColor = DefaultLookup.getColor(this, ui, "TableHeader.focusCellBackground");
}
if (fgColor == null) {
fgColor = header.getForeground();
}
if (bgColor == null) {
bgColor = header.getBackground();
}
setForeground(fgColor);
setBackground(bgColor);
setFont(header.getFont());
isPaintingForPrint = header.isPaintingForPrint();
}
if (!isPaintingForPrint && table.getRowSorter() != null) {
if (!horizontalTextPositionSet) {
// There is a row sorter, and the developer hasn't
// set a text position, change to leading.
setHorizontalTextPosition(JLabel.LEADING);
}
SortOrder sortOrder = getColumnSortOrder(table, column);
if (sortOrder != null) {
switch(sortOrder) {
case ASCENDING:
sortIcon = DefaultLookup.getIcon(
this, ui, "Table.ascendingSortIcon");
break;
case DESCENDING:
sortIcon = DefaultLookup.getIcon(
this, ui, "Table.descendingSortIcon");
break;
case UNSORTED:
sortIcon = DefaultLookup.getIcon(
this, ui, "Table.naturalSortIcon");
break;
}
}
}
}
setText(value == null ? "" : value.toString());
setIcon(sortIcon);
sortArrow = sortIcon;
Border border = null;
if (hasFocus) {
border = DefaultLookup.getBorder(this, ui, "TableHeader.focusCellBorder");
}
if (border == null) {
border = DefaultLookup.getBorder(this, ui, "TableHeader.cellBorder");
}
setBorder(border);
return this;
}
示例2: getDefaultOpenIcon
import sun.swing.DefaultLookup; //导入方法依赖的package包/类
/**
* Returns the default icon, for the current laf, that is used to
* represent non-leaf nodes that are expanded.
*/
public Icon getDefaultOpenIcon() {
return DefaultLookup.getIcon(this, ui, "Tree.openIcon");
}
示例3: getDefaultClosedIcon
import sun.swing.DefaultLookup; //导入方法依赖的package包/类
/**
* Returns the default icon, for the current laf, that is used to
* represent non-leaf nodes that are not expanded.
*/
public Icon getDefaultClosedIcon() {
return DefaultLookup.getIcon(this, ui, "Tree.closedIcon");
}
示例4: getDefaultLeafIcon
import sun.swing.DefaultLookup; //导入方法依赖的package包/类
/**
* Returns the default icon, for the current laf, that is used to
* represent leaf nodes.
*/
public Icon getDefaultLeafIcon() {
return DefaultLookup.getIcon(this, ui, "Tree.leafIcon");
}
示例5: getDefaultOpenIcon
import sun.swing.DefaultLookup; //导入方法依赖的package包/类
/**
* Returns the default icon, for the current laf, that is used to
* represent non-leaf nodes that are expanded.
*
* @return the default icon, for the current laf, that is used to
* represent non-leaf nodes that are expanded.
*/
public Icon getDefaultOpenIcon() {
return DefaultLookup.getIcon(this, ui, "Tree.openIcon");
}
示例6: getDefaultClosedIcon
import sun.swing.DefaultLookup; //导入方法依赖的package包/类
/**
* Returns the default icon, for the current laf, that is used to
* represent non-leaf nodes that are not expanded.
*
* @return the default icon, for the current laf, that is used to
* represent non-leaf nodes that are not expanded.
*/
public Icon getDefaultClosedIcon() {
return DefaultLookup.getIcon(this, ui, "Tree.closedIcon");
}
示例7: getDefaultLeafIcon
import sun.swing.DefaultLookup; //导入方法依赖的package包/类
/**
* Returns the default icon, for the current laf, that is used to
* represent leaf nodes.
*
* @return the default icon, for the current laf, that is used to
* represent leaf nodes.
*/
public Icon getDefaultLeafIcon() {
return DefaultLookup.getIcon(this, ui, "Tree.leafIcon");
}