/** * updateUI is overridden to set the colors of the Tree's renderer to * match that of the table. */ @Override public void updateUI () { super.updateUI(); // Make the tree's cell renderer use the table's cell selection // colors. TreeCellRenderer tcr = getCellRenderer(); if (tcr instanceof DefaultTreeCellRenderer) { DefaultTreeCellRenderer dtcr = ((DefaultTreeCellRenderer) tcr); // For 1.1 uncomment this, 1.2 has a bug that will cause an // exception to be thrown if the border selection color is // null. dtcr.setBorderSelectionColor(null); dtcr.setTextSelectionColor(UIManager.getColor("Table.selectionForeground")); dtcr.setBackgroundSelectionColor(UIManager.getColor("Table.selectionBackground")); } } }
/** * updateUI is overridden to set the colors of the Tree's renderer * to match that of the table. */ @Override public void updateUI() { super.updateUI(); // Make the tree's cell renderer use the table's cell selection // colors. // TODO JW: need to revisit... // a) the "real" of a JXTree is always wrapped into a DelegatingRenderer // consequently the if-block never executes // b) even if it does it probably (?) should not // unconditionally overwrite custom selection colors. // Check for UIResources instead. TreeCellRenderer tcr = getCellRenderer(); if (tcr instanceof DefaultTreeCellRenderer) { DefaultTreeCellRenderer dtcr = ((DefaultTreeCellRenderer) tcr); // For 1.1 uncomment this, 1.2 has a bug that will cause an // exception to be thrown if the border selection color is null. dtcr.setBorderSelectionColor(null); dtcr.setTextSelectionColor( UIManager.getColor("Table.selectionForeground")); dtcr.setBackgroundSelectionColor( UIManager.getColor("Table.selectionBackground")); } }
/** * updateUI is overridden to set the colors of the Tree's renderer * to match that of the table. */ @Override public void updateUI() { super.updateUI(); // Make the tree's cell renderer use the table's cell selection // colors. // TODO JW: need to revisit... // a) the "real" of a JXTree is always wrapped into a DelegatingRenderer // consequently the if-block never executes // b) even if it does it probably (?) should not // unconditionally overwrite custom selection colors. // Check for UIResources instead. TreeCellRenderer tcr = getCellRenderer(); if (tcr instanceof DefaultTreeCellRenderer) { DefaultTreeCellRenderer dtcr = ((DefaultTreeCellRenderer) tcr); // For 1.1 uncomment this, 1.2 has a bug that will cause an // exception to be thrown if the border selection color is null. dtcr.setBorderSelectionColor(null); dtcr.setTextSelectionColor( UIManager.getColor("Table.selectionForeground")); dtcr.setBackgroundSelectionColor( UIManager.getColor("Table.selectionBackground")); } }
/** * updateUI is overridden to set the colors of the Tree's renderer * to match that of the table. */ @Override public void updateUI() { super.updateUI(); // Make the tree's cell renderer use the table's cell selection // colors. // TODO JW: need to revisit... // a) the "real" of a JXTree is always wrapped into a DelegatingRenderer // consequently the if-block never executes // b) even if it does it probably (?) should not // unconditionally overwrite custom selection colors. // Check for UIResources instead. TreeCellRenderer tcr = getCellRenderer(); if (tcr instanceof DefaultTreeCellRenderer) { DefaultTreeCellRenderer dtcr = ((DefaultTreeCellRenderer) tcr); // For 1.1 uncomment this, 1.2 has a bug that will cause an // exception to be thrown if the border selection color is null. dtcr.setBorderSelectionColor(null); dtcr.setTextSelectionColor( UIManager.getColor("Table.selectionForeground")); dtcr.setBackgroundSelectionColor( UIManager.getColor("Table.selectionBackground")); } }
/** * updateUI is overridden to set the colors of the Tree's renderer * to match that of the table. */ @Override public void updateUI() { super.updateUI(); // Make the tree's cell renderer use the table's cell selection // colors. // TODO JW: need to revisit... // a) the "real" of a JXTree is always wrapped into a DelegatingRenderer // consequently the if-block never executes // b) even if it does it probably (?) should not // unconditionally overwrite custom selection colors. // Check for UIResources instead. TreeCellRenderer tcr = getCellRenderer(); if (tcr instanceof DefaultTreeCellRenderer) { DefaultTreeCellRenderer dtcr = ((DefaultTreeCellRenderer) tcr); // For 1.1 uncomment this, 1.2 has a bug that will cause an // exception to be thrown if the border selection color is null. dtcr.setBorderSelectionColor(null); dtcr.setTextSelectionColor( UIManager.getColor("Table.selectionForeground")); dtcr.setBackgroundSelectionColor( UIManager.getColor("Table.selectionBackground")); } }
/** * updateUI is overridden to set the colors of the Tree's renderer * to match that of the table. */ @Override public void updateUI() { super.updateUI(); // Make the tree's cell renderer use the table's cell selection // colors. // TODO JW: need to revisit... // a) the "real" of a JXTree is always wrapped into a DelegatingRenderer // consequently the if-block never executes // b) even if it does it probably (?) should not // unconditionally overwrite custom selection colors. // Check for UIResources instead. TreeCellRenderer tcr = getCellRenderer(); if (tcr instanceof DefaultTreeCellRenderer) { DefaultTreeCellRenderer dtcr = ((DefaultTreeCellRenderer) tcr); // For 1.1 uncomment this, 1.2 has a bug that will cause an // exception to be thrown if the border selection color is null. dtcr.setBorderSelectionColor(null); dtcr.setTextSelectionColor( UIManager.getColor("Table.selectionForeground")); dtcr.setBackgroundSelectionColor( UIManager.getColor("Table.selectionBackground")); } }
customIconRenderer.setTextSelectionColor(Color.white); customIconRenderer.setBackgroundSelectionColor(Color.blue); customIconRenderer.setBorderSelectionColor(Color.black); customIconRenderer.setBackgroundNonSelectionColor(new Color(238, 238, 244));
renderer.setBackgroundSelectionColor(color); renderer.setBackgroundNonSelectionColor(color); renderer.setBorderSelectionColor(color); renderer.setTextSelectionColor(Color.BLACK);
renderer.setBackgroundSelectionColor(color); renderer.setBackgroundNonSelectionColor(color); renderer.setBorderSelectionColor(color); renderer.setTextSelectionColor(Color.BLACK);
setBackgroundNonSelectionColor(Color.BLACK); setBackgroundSelectionColor(Color.GRAY); setBorderSelectionColor(Color.GRAY); setForeground(Color.WHITE); return (this);
renderer.setBorderSelectionColor(renderer.getBackgroundSelectionColor());
dtcr.setBorderSelectionColor(style.getColor(cellContext, ColorType.FOCUS));
renderer.setBorderSelectionColor(renderer.getBackgroundSelectionColor());