下面列出了javax.swing.JTable#setForeground ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
public static void setEnabled(JTable table, boolean enabled) {
table.setEnabled(enabled);
if (enabled) {
table.setRowSelectionAllowed(true);
table.setForeground(Color.black);
table.setBackground(Color.white);
} else {
table.setRowSelectionAllowed(false);
table.setForeground(Color.gray);
table.setBackground(Color.lightGray);
}
}
public static void setTableProperties(JTable table) {
table.setBackground(ColorPalette.DARK_BACKGROUND_COLOR);
table.setForeground(ColorPalette.FOREGROUND_COLOR);
table.setSelectionBackground(ColorPalette.DARK_BACKGROUND_COLOR.brighter());
table.setSelectionForeground(ColorPalette.FOREGROUND_COLOR.brighter());
table.setFont(Fonts.FONT);
table.getTableHeader().setDefaultRenderer(new DefaultHeaderRenderer(table.getTableHeader().getDefaultRenderer()));
}
public static void addStyle(JTable jTable) {
jTable.setForeground(fontColor);
jTable.setBackground(Color.WHITE);
jTable.setFont(GraphicsUtils.getFont("Monospaced", 0, 13));
}