Java Code Examples for javax.swing.JTable#setForeground()

The following examples show how to use javax.swing.JTable#setForeground() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TableUtils.java    From lucene-solr with Apache License 2.0 5 votes vote down vote up
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);
  }
}
 
Example 2
Source File: JTableFactory.java    From WorldGrower with GNU General Public License v3.0 5 votes vote down vote up
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()));
}
 
Example 3
Source File: UIRes.java    From RipplePower with Apache License 2.0 4 votes vote down vote up
public static void addStyle(JTable jTable) {
	jTable.setForeground(fontColor);
	jTable.setBackground(Color.WHITE);
	jTable.setFont(GraphicsUtils.getFont("Monospaced", 0, 13));
}