void updateStatus(String text, Color color) { statusLabel.setText(text); statusLabel.setForeground(color); } }
private JLabel createSmallLabel(String text) { JLabel label = new JLabel(text, SwingConstants.CENTER); label.setFont(FontManager.getRunescapeSmallFont()); label.setForeground(LAP_DATA_COLOR); return label; } }
private JPanel createInfoPanel(String text) { JPanel panel = new JPanel(new BorderLayout()); panel.setBorder(new EmptyBorder(7, 8, 6, 8)); panel.setBackground(ColorScheme.DARK_GRAY_COLOR); JLabel infoLabel = new JShadowedLabel(text); infoLabel.setForeground(ColorScheme.LIGHT_GRAY_COLOR.darker()); infoLabel.setFont(FontManager.getRunescapeSmallFont()); panel.add(infoLabel); return panel; }
if (value.isCategory()) { if (categoryLabel == null) { categoryLabel = new JLabel(); categoryLabel.setOpaque(true); categoryLabel.setBackground(new Color(.5f, .5f, .6f)); categoryLabel.setForeground(Color.white); categoryLabel.setHorizontalAlignment(SwingConstants.CENTER); categoryLabel.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1)); categoryLabel.setText(value.category); return categoryLabel; } else { if (testLabel == null) { testLabel = new JLabel(); testLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 1, 0)); testLabel.setText(value.test.getTestName()); testLabel.setForeground(list.getSelectionForeground()); } else { testLabel.setBackground(list.getBackground()); testLabel.setForeground(list.getForeground());
JLabel tooBigToShowLabel = new JLabel("The dataset is too big to show."); tooBigToShowLabel.setForeground(Color.WHITE); add(tooBigToShowLabel); return; add(button); } else { JPanel panel = new JPanel(); panel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createLineBorder(TangoColorFactory.ALUMINIUM_6),
private ExEntryPanel() { setBorder(BorderFactory.createEtchedBorder()); label = new JLabel(" "); entry = new ExTextField(); entry.setBorder(null); setFontForElements(); setForeground(entry.getForeground()); setBackground(entry.getBackground()); label.setForeground(entry.getForeground()); label.setBackground(entry.getBackground()); GridBagLayout layout = new GridBagLayout(); GridBagConstraints gbc = new GridBagConstraints(); setLayout(layout); gbc.gridx = 0; layout.setConstraints(this.label, gbc); add(this.label); gbc.gridx = 1; gbc.weightx = 1.0; gbc.fill = GridBagConstraints.HORIZONTAL; layout.setConstraints(entry, gbc); add(entry); setBorder(BorderFactory.createEtchedBorder()); adapter = new ComponentAdapter() { public void componentResized(ComponentEvent e) { positionPanel(); } }; }
@Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { JLabel defaultLabel = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); defaultLabel.setHorizontalAlignment(JLabel.CENTER); // colors String val = (String) value; String[] valsList = val.split("/"); if (valsList.length == 2 && !valsList[0].equals(valsList[1])) { // green draw Color defaultBack = defaultLabel.getBackground(); greenLabel.setText(val); greenLabel.setHorizontalAlignment(JLabel.CENTER); greenLabel.setFont(defaultLabel.getFont()); greenLabel.setForeground(Color.black); greenLabel.setOpaque(true); greenLabel.setBackground(new Color(156, 240, 146)); greenLabel.setBorder(new LineBorder(defaultBack, 1)); return greenLabel; } else { // default draw return defaultLabel; } } };
MyRenderer() { setBackground(BACKGROUND); setLayout(new BorderLayout()); pHead.setLayout(new BorderLayout()); pHead.setBackground(BACKGROUND); pHead.add(pList, BorderLayout.LINE_START); pHead.add(lActive, BorderLayout.LINE_END); pHead.add(pError, BorderLayout.PAGE_END); lId.setHorizontalAlignment(SwingConstants.RIGHT); lName.setForeground(Color.BLUE); lCounters.setForeground(Color.GRAY); pList.setLayout(new FlowLayout(FlowLayout.LEFT, 4, 2)); pList.setBackground(BACKGROUND); pList.add(lId); pList.add(lName); pList.add(lCounters); pError.setVisible(false); pError.setLayout(new FlowLayout(FlowLayout.LEFT, 4, 2)); pError.setBackground(BACKGROUND); pError.add(lErrorSpacer); pError.add(lError); lError.setForeground(Color.RED); add(pHead, BorderLayout.PAGE_START); }
public PluginErrorPanel() { setOpaque(false); setBorder(new EmptyBorder(50, 10, 0, 10)); setLayout(new BorderLayout()); noResultsTitle.setForeground(Color.WHITE); noResultsTitle.setHorizontalAlignment(SwingConstants.CENTER); noResultsDescription.setFont(FontManager.getRunescapeSmallFont()); noResultsDescription.setForeground(Color.GRAY); noResultsDescription.setHorizontalAlignment(SwingConstants.CENTER); add(noResultsTitle, BorderLayout.NORTH); add(noResultsDescription, BorderLayout.CENTER); setVisible(false); }
bottomPanel = new JPanel(new GridBagLayout()); contentPane.add(content, new GridBagConstraints(0, 0, 1, 1, 1, 1, NORTH, BOTH, new Insets(0, 0, 0, 0), 0, 0)); JLabel settings = new JLabel("Settings"); JLabel description = new JLabel("Description"); settings.setForeground(new Color(255, 255, 255)); description.setForeground(new Color(255, 255, 255)); mavenTextField.setMinimumSize(mavenTextField.getPreferredSize()); mavenLabel.setForeground(new Color(170, 170, 170)); mavenDesc.setForeground(new Color(170, 170, 170)); ideaBox = new SetupCheckBox(); ideaLabel.setForeground(new Color(170, 170, 170)); ideaDesc.setForeground(new Color(170, 170, 170)); eclipseBox = new SetupCheckBox(); eclipseLabel.setForeground(new Color(170, 170, 170)); eclipseDesc.setForeground(new Color(170, 170, 170)); offlineLabel.setForeground(new Color(170, 170, 170)); offlineDesc.setForeground(new Color(170, 170, 170)); offlineBox.setBackground(new Color(36, 36, 36)); kotlinBox = new SetupCheckBox(); kotlinLabel.setForeground(new Color(170, 170, 170)); kotlinDesc.setForeground(new Color(170, 170, 170));
public ModalEntryDialog(@NotNull Editor editor, @NotNull String prompt) { super((Frame)null, true); myParent = editor.getContentComponent(); myLabel = new JLabel(prompt); myEntry = new JTextField(); myLabel.setFont(font); myEntry.setFont(font); setBackground(myEntry.getBackground()); myLabel.setForeground(myEntry.getForeground()); myLabel.setBackground(myEntry.getBackground());
protected void showMessage(String message, boolean warning) { jLabel_MessageBarIcon.setText(""); // No text, just an icon if (warning) { jLabel_MessageBarIcon.setIcon(IconSet.WARNING_16X16); jLabel_MessageBar.setForeground(Color.RED); // PRI4 Make darker red (more readable than default red) } else { jLabel_MessageBarIcon.setIcon(IconSet.INFO_16X16); jLabel_MessageBar.setForeground(Color.BLACK); } jLabel_MessageBar.setText(message); // Display the actual message next to the icon jLabel_MessageBar.setForeground(Color.BLACK); }
label = new JLabel(); label.setOpaque(true); fileSystemView = FileSystemView.getFileSystemView(); File file = (File)node.getUserObject(); label.setIcon(fileSystemView.getSystemIcon(file)); label.setText(fileSystemView.getSystemDisplayName(file)); label.setToolTipText(file.getPath()); label.setForeground(textSelectionColor); } else { label.setBackground(backgroundNonSelectionColor); label.setForeground(textNonSelectionColor);
JLabel label = new JLabel(labelText); label.setPreferredSize(new Dimension(45, 0)); label.setForeground(Color.WHITE);
labelRender.setText("{" + symbol + "}"); labelRender.setForeground(symbolsTextColor); labelRender.setSize(symbolWidth, symbolWidth); labelRender.setVerticalAlignment(SwingConstants.CENTER); labelRender.setFont(new Font(labelFont.getName(), Font.PLAIN + Font.BOLD, fontSizeToUse - 1)); // - for "..." fix in text
public CountryItemEditor() { panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS)); panel.setBackground(new Color(0, 100,190, 255)); panel.add(labelItem); labelItem.setAlignmentX(Component.LEFT_ALIGNMENT); labelItem.setMaximumSize(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE)); labelItem.setBorder(new EmptyBorder(0, 5, 0, 0)); labelItem.setOpaque(false); labelItem.setForeground(Color.WHITE); editValue = null; }
public ProgressBar() { setLayout(new BorderLayout()); // The background color should be overridden setBackground(Color.GREEN.darker()); setForeground(Color.GREEN.brighter()); setPreferredSize(new Dimension(100, 16)); leftLabel.setFont(FontManager.getRunescapeSmallFont()); leftLabel.setForeground(Color.WHITE); leftLabel.setBorder(new EmptyBorder(2, 5, 0, 0)); rightLabel.setFont(FontManager.getRunescapeSmallFont()); rightLabel.setForeground(Color.WHITE); rightLabel.setBorder(new EmptyBorder(2, 0, 0, 5)); centerLabel.setFont(FontManager.getRunescapeSmallFont()); centerLabel.setForeground(Color.WHITE); centerLabel.setHorizontalAlignment(SwingConstants.CENTER); centerLabel.setBorder(new EmptyBorder(2, 0, 0, 0)); // Adds components to be automatically redrawn when paintComponents is called add(leftLabel, BorderLayout.WEST); add(centerLabel, BorderLayout.CENTER); add(rightLabel, BorderLayout.EAST); }
private JPanel buildCheckboxPanel(SkillDataBonus bonus) { JPanel uiOption = new JPanel(new BorderLayout()); JLabel uiLabel = new JLabel(bonus.getName()); JCheckBox uiCheckbox = new JCheckBox(); uiLabel.setForeground(Color.WHITE); uiLabel.setFont(FontManager.getRunescapeSmallFont()); uiOption.setBorder(BorderFactory.createEmptyBorder(3, 7, 3, 0)); uiOption.setBackground(ColorScheme.DARKER_GRAY_COLOR); // Adjust XP bonus depending on check-state of the boxes. uiCheckbox.addActionListener(event -> adjustCheckboxes(uiCheckbox, bonus)); uiCheckbox.setBackground(ColorScheme.MEDIUM_GRAY_COLOR); uiOption.add(uiLabel, BorderLayout.WEST); uiOption.add(uiCheckbox, BorderLayout.EAST); bonusCheckBoxes.add(uiCheckbox); return uiOption; }
public PortNotesRow(String notes) { setLayout(new BoxLayout(this, BoxLayout.LINE_AXIS)); notesLabel = new JLabel(notes); notesLabel.setFont(Theme.SMALL_FONT); notesLabel.setForeground(Theme.TEXT_NORMAL_COLOR); notesLabel.setBorder(BorderFactory.createEmptyBorder(TOP_PADDING, 0, BOTTOM_PADDING, 0)); add(Box.createHorizontalStrut(PortView.LABEL_WIDTH + 10)); add(this.notesLabel); add(Box.createHorizontalGlue()); setBorder(Theme.PARAMETER_NOTES_BORDER); }
@Override public void setDimmed(boolean dimmed) { super.setDimmed(dimmed); if (dimmed) { leftLabel.setForeground(Color.GRAY); rightLabel.setForeground(Color.GRAY); centerLabel.setText(dimmedText); } else { leftLabel.setForeground(Color.WHITE); rightLabel.setForeground(Color.WHITE); centerLabel.setText(centerLabelText); } }