@Override public Component getListCellRendererComponent( final JList<?> list, final Object value, final int index, final boolean selected, final boolean expanded) { file = new IOFile(value.toString()); label.setIcon(BaseXImages.file(file)); label.setText(""); label.setToolTipText(ProjectFile.toString(file, true)); if (selected) { label.setBackground(getSelectionBackground()); label.setForeground(getSelectionForeground()); } else { label.setBackground(GUIConstants.BACK); label.setForeground(GUIConstants.TEXT); } return label; }
/** * Sets the status text. * * @param txt the text to be set */ public void setError(final String txt) { label.setText(txt); label.setForeground(GUIConstants.RED); }
/** * Sets the status text. * * @param txt the text to be set */ public void setText(final String txt) { label.setText(txt); label.setForeground(Color.BLACK); }