本文整理匯總了Java中javax.swing.plaf.basic.BasicLabelUI類的典型用法代碼示例。如果您正苦於以下問題:Java BasicLabelUI類的具體用法?Java BasicLabelUI怎麽用?Java BasicLabelUI使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
BasicLabelUI類屬於javax.swing.plaf.basic包,在下文中一共展示了BasicLabelUI類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: recreateLabels
import javax.swing.plaf.basic.BasicLabelUI; //導入依賴的package包/類
private void recreateLabels( String[] dataNames )
{
cCols.removeAll();
cRows.removeAll();
int dims = dataNames.length;
cCols.setLayout( createLabelLayout( dims, true ) );
cRows.setLayout( createLabelLayout( dims, false ) );
Insets insetsH = new Insets( 0, 5, 0, 5 );
Insets insetsV = new Insets( 5, 0, 5, 0 );
GridBagConstraintsBuilder builder = new GridBagConstraintsBuilder();
BasicLabelUI verticalUI = new VerticalLabelUI( false );
for ( int i = 0; i < dims; ++i ) {
JLabel lblH = new JLabel( dataNames[i] );
lblH.setHorizontalAlignment( SwingConstants.CENTER );
lblH.setVisible( false );
cCols.add( lblH, builder.position( i, 0 ).insets( insetsH ).build() );
JLabel lblV = new JLabel( dataNames[i] );
lblV.setUI( verticalUI );
lblV.setHorizontalAlignment( SwingConstants.CENTER );
lblV.setVisible( false );
cRows.add( lblV, builder.position( 0, i ).insets( insetsV ).build() );
}
updateLabelLayout( true );
updateLabelLayout( false );
}
示例2: TagTreeCellRenderer
import javax.swing.plaf.basic.BasicLabelUI; //導入依賴的package包/類
public TagTreeCellRenderer() {
setUI(new BasicLabelUI());
setOpaque(false);
//setBackground(Color.green);
setBackgroundNonSelectionColor(Color.white);
//setBackgroundSelectionColor(Color.ORANGE);
}
示例3: getTableCellRendererComponent
import javax.swing.plaf.basic.BasicLabelUI; //導入依賴的package包/類
@Override
public Component getTableCellRendererComponent(JTable table,
Object value, boolean isSelected, boolean hasFocus, int row,
int column
) {
if (value instanceof CellValue) {
double cellValue = ((CellValue) value).getValue();
this.setBackground(doubleToColor.apply(cellValue));
this.setText("");
this.setToolTipText(format(cellValue));
} else {
this.setText(value.toString());
this.setBackground(Color.WHITE);
this.setHorizontalAlignment(JLabel.CENTER);
this.setToolTipText("");
}
if (table.convertRowIndexToModel(row) == 0) {
this.setUI(new VerticalLabelUI(false));
this.setHorizontalAlignment(JLabel.LEFT);
this.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
this.setFont(getHeatmapFont());
} else {
this.setUI(new BasicLabelUI());
this.setHorizontalAlignment(JLabel.RIGHT);
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
this.setFont(getHeatmapFont());
}
return this;
}
示例4: updateUI
import javax.swing.plaf.basic.BasicLabelUI; //導入依賴的package包/類
@Override
public void
updateUI() { setUI(new BasicLabelUI()); }
示例5: MyTreeCellRenderer
import javax.swing.plaf.basic.BasicLabelUI; //導入依賴的package包/類
public MyTreeCellRenderer() {
setUI(new BasicLabelUI());
setOpaque(false);
setBackgroundNonSelectionColor(Color.white);
}
示例6: DumpTreeCellRenderer
import javax.swing.plaf.basic.BasicLabelUI; //導入依賴的package包/類
public DumpTreeCellRenderer() {
setUI(new BasicLabelUI());
setOpaque(false);
setBackgroundNonSelectionColor(Color.white);
}