本文整理了Java中javax.swing.UIManager.getBorder()
方法的一些代码示例,展示了UIManager.getBorder()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UIManager.getBorder()
方法的具体详情如下:
包路径:javax.swing.UIManager
类名称:UIManager
方法名:getBorder
暂无
代码示例来源:origin: alibaba/druid
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
boolean hasFocus, int row, int column) {
JTableHeader header = table.getTableHeader();
if (header != null) {
setForeground(header.getForeground());
setBackground(header.getBackground());
setFont(header.getFont());
}
setHorizontalAlignment(JLabel.CENTER);
this.setText((value == null) ? "" : value.toString());
setBorder(UIManager.getBorder("TableHeader.cellBorder"));
return this;
}
};
代码示例来源:origin: alibaba/druid
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
boolean hasFocus, int row, int column) {
JTableHeader header = table.getTableHeader();
if (header != null) {
setForeground(header.getForeground());
setBackground(header.getBackground());
setFont(header.getFont());
}
setHorizontalAlignment(JLabel.CENTER);
setText((value == null) ? "" : value.toString());
setBorder(UIManager.getBorder("TableHeader.cellBorder"));
return this;
}
};
代码示例来源:origin: alibaba/druid
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
boolean hasFocus, int row, int column) {
JTableHeader header = table.getTableHeader();
if (header != null) {
setForeground(header.getForeground());
setBackground(header.getBackground());
setFont(header.getFont());
}
setHorizontalAlignment(JLabel.CENTER);
setText((value == null) ? "" : value.toString());
setBorder(UIManager.getBorder("TableHeader.cellBorder"));
return this;
}
};
代码示例来源:origin: alibaba/druid
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
boolean hasFocus, int row, int column) {
JTableHeader header = table.getTableHeader();
if (header != null) {
setForeground(header.getForeground());
setBackground(header.getBackground());
setFont(header.getFont());
}
setHorizontalAlignment(JLabel.CENTER);
setText((value == null) ? "" : value.toString());
setBorder(UIManager.getBorder("TableHeader.cellBorder"));
return this;
}
};
代码示例来源:origin: alibaba/druid
public Component getTableCellRendererComponent(JTable table, Object obj, boolean isSelected, boolean hasFocus,
int row, int col) {
int rowCountNow = refTable.getRowCount() / rowSpan;
((DefaultTableModel) table.getModel()).setRowCount(rowCountNow);
JTableHeader header = refTable.getTableHeader();
this.setOpaque(true);
setBorder(UIManager.getBorder("TableHeader.cellBorder"));// 设置为TableHeader的边框类型
setHorizontalAlignment(CENTER);// 让text居中显示
setBackground(header.getBackground());// 设置背景色为TableHeader的背景色
if (isSelect(row)) // 当选取单元格时,在row header上设置成选取颜色
{
setForeground(Color.white);
setBackground(Color.lightGray);
} else {
setForeground(header.getForeground());
}
setFont(header.getFont());
if (row <= rowCountNow) {
showCol(row);
}
return this;
}
代码示例来源:origin: stackoverflow.com
this.setBorder(UIManager.getBorder("TableHeader.cellBorder"));
this.setBackground(UIManager.getColor("TableHeader.background"));
this.setForeground(UIManager.getColor("TableHeader.foreground"));
代码示例来源:origin: bobbylight/RSyntaxTextArea
/**
* Returns the border used by tool tips in this look and feel.
*
* @return The border.
*/
public static Border getToolTipBorder() {
Border border = UIManager.getBorder("ToolTip.border");
if (border==null || isNimbusLookAndFeel()) {
border = UIManager.getBorder("nimbusBorder");
if (border==null) {
border = BorderFactory.createLineBorder(SystemColor.controlDkShadow);
}
}
return border;
}
代码示例来源:origin: ron190/jsql-injection
Border border = UIManager.getBorder("TextField.border");
代码示例来源:origin: com.alibaba/druid
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
boolean hasFocus, int row, int column) {
JTableHeader header = table.getTableHeader();
if (header != null) {
setForeground(header.getForeground());
setBackground(header.getBackground());
setFont(header.getFont());
}
setHorizontalAlignment(JLabel.CENTER);
setText((value == null) ? "" : value.toString());
setBorder(UIManager.getBorder("TableHeader.cellBorder"));
return this;
}
};
代码示例来源:origin: com.alibaba/druid
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
boolean hasFocus, int row, int column) {
JTableHeader header = table.getTableHeader();
if (header != null) {
setForeground(header.getForeground());
setBackground(header.getBackground());
setFont(header.getFont());
}
setHorizontalAlignment(JLabel.CENTER);
setText((value == null) ? "" : value.toString());
setBorder(UIManager.getBorder("TableHeader.cellBorder"));
return this;
}
};
代码示例来源:origin: com.alibaba/druid
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
boolean hasFocus, int row, int column) {
JTableHeader header = table.getTableHeader();
if (header != null) {
setForeground(header.getForeground());
setBackground(header.getBackground());
setFont(header.getFont());
}
setHorizontalAlignment(JLabel.CENTER);
setText((value == null) ? "" : value.toString());
setBorder(UIManager.getBorder("TableHeader.cellBorder"));
return this;
}
};
代码示例来源:origin: com.alibaba/druid
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
boolean hasFocus, int row, int column) {
JTableHeader header = table.getTableHeader();
if (header != null) {
setForeground(header.getForeground());
setBackground(header.getBackground());
setFont(header.getFont());
}
setHorizontalAlignment(JLabel.CENTER);
this.setText((value == null) ? "" : value.toString());
setBorder(UIManager.getBorder("TableHeader.cellBorder"));
return this;
}
};
代码示例来源:origin: com.alibaba/druid
public Component getTableCellRendererComponent(JTable table, Object obj, boolean isSelected, boolean hasFocus,
int row, int col) {
int rowCountNow = refTable.getRowCount() / rowSpan;
((DefaultTableModel) table.getModel()).setRowCount(rowCountNow);
JTableHeader header = refTable.getTableHeader();
this.setOpaque(true);
setBorder(UIManager.getBorder("TableHeader.cellBorder"));// 设置为TableHeader的边框类型
setHorizontalAlignment(CENTER);// 让text居中显示
setBackground(header.getBackground());// 设置背景色为TableHeader的背景色
if (isSelect(row)) // 当选取单元格时,在row header上设置成选取颜色
{
setForeground(Color.white);
setBackground(Color.lightGray);
} else {
setForeground(header.getForeground());
}
setFont(header.getFont());
if (row <= rowCountNow) {
showCol(row);
}
return this;
}
代码示例来源:origin: com.synaptix/SynaptixSwing
/** Installs the borders of this dialog and its title header */
public void installBorders() {
Border border = UIManager.getBorder("FloatingDialog.dialogBorder"); //$NON-NLS-1$
Border titleBorder = UIManager.getBorder("FloatingDialog.titleBorder"); //$NON-NLS-1$
title.setBorder(titleBorder);
((JPanel) getContentPane()).setBorder(border);
}
代码示例来源:origin: com.github.insubstantial/flamingo
/**
* Installs defaults on the associated ribbon.
*/
protected void installDefaults() {
Border b = this.ribbon.getBorder();
if (b == null || b instanceof UIResource) {
Border toSet = UIManager.getBorder("Ribbon.border");
if (toSet == null)
toSet = new BorderUIResource.EmptyBorderUIResource(1, 2, 1, 2);
this.ribbon.setBorder(toSet);
}
}
代码示例来源:origin: atarw/material-ui-swing
@Override
public void installUI (JComponent c) {
super.installUI (c);
JSpinner spinner = (JSpinner) c;
spinner.setOpaque (false);
spinner.setFont (UIManager.getFont ("Spinner.font"));
spinner.setBackground (UIManager.getColor ("Spinner.background"));
spinner.setForeground (UIManager.getColor ("Spinner.foreground"));
spinner.setBorder (UIManager.getBorder ("Spinner.border"));
}
代码示例来源:origin: atarw/material-ui-swing
@Override
public void installUI (JComponent c) {
super.installUI (c);
JMenu menu = (JMenu) c;
menu.setFont (UIManager.getFont ("Menu.font"));
menu.setBorder (UIManager.getBorder ("Menu.border"));
menu.setBackground (UIManager.getColor ("Menu.background"));
menu.setForeground (UIManager.getColor ("Menu.foreground"));
menu.setOpaque (UIManager.getBoolean ("Menu.opaque"));
}
代码示例来源:origin: atarw/material-ui-swing
@Override
public void installUI (JComponent c) {
super.installUI (c);
AbstractButton button = (AbstractButton) c;
button.setOpaque (UIManager.getBoolean ("Button.opaque"));
button.setBorder (UIManager.getBorder ("Button.border"));
button.setBackground (UIManager.getColor ("Button.background"));
button.setForeground (UIManager.getColor ("Button.foreground"));
button.setFont (UIManager.getFont ("Button.font"));
}
代码示例来源:origin: com.jtattoo/JTattoo
protected void installDefaults() {
LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font");
tabAreaBackground = UIManager.getColor("TabbedPane.tabAreaBackground");
selectedColor = UIManager.getColor("TabbedPane.selected");
textIconGap = UIManager.getInt("TabbedPane.textIconGap");
tabInsets = UIManager.getInsets("TabbedPane.tabInsets");
selectedTabPadInsets = UIManager.getInsets("TabbedPane.selectedTabPadInsets");
tabAreaInsets = UIManager.getInsets("TabbedPane.tabAreaInsets");
contentBorderInsets = UIManager.getInsets("TabbedPane.contentBorderInsets");
tabRunOverlay = UIManager.getInt("TabbedPane.tabRunOverlay");
tabPane.setBorder(UIManager.getBorder("TabbedPane.boder"));
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
RowHeaderRenderer(HSSFSheet sheet, JTable table, int extraHeight) {
this.sheet = sheet;
this.extraHeight = extraHeight;
JTableHeader header = table.getTableHeader();
setOpaque(true);
setBorder(UIManager.getBorder("TableHeader.cellBorder"));
setHorizontalAlignment(CENTER);
setForeground(header.getForeground());
setBackground(header.getBackground());
setFont(header.getFont());
}
内容来源于网络,如有侵权,请联系作者删除!