private void uiStyle () { content.setBackground(new Color(36, 36, 36)); content.setForeground(new Color(255, 255, 255)); bottomPanel.setBackground(new Color(36, 36, 36)); bottomPanel.setForeground(new Color(255, 255, 255)); buttonPanel.setBackground(new Color(36, 36, 36)); buttonPanel.setForeground(new Color(255, 255, 255)); linkText.setForeground(new Color(20, 150, 20)); contentPane.setBackground(new Color(36, 36, 36)); Border line = BorderFactory.createLineBorder(new Color(80, 80, 80)); Border empty = new EmptyBorder(4, 4, 4, 4); CompoundBorder border = new CompoundBorder(line, empty); mavenTextField.setBorder(border); mavenTextField.setCaretColor(new Color(255, 255, 255)); mavenTextField.setBackground(new Color(46, 46, 46)); mavenTextField.setForeground(new Color(255, 255, 255)); }
public void refreshScoreField(Score score) { scoreField.setForeground(determineScoreFieldForeground(score)); scoreField.setText("Latest best score: " + score); }
@Override public void focusGained(FocusEvent e) { displayInput.getTextField().setForeground(INACTIVE_CLOCK_COLOR); displayInput.getTextField().selectAll(); }
private void updateTotals(int usedCpuPower, int usedMemory, int usedNetworkBandwidth, boolean used) { computerLabel.setEnabled(used); cpuPowerField.setText(usedCpuPower + " GHz / " + getComputerCpuPower() + " GHz"); cpuPowerField.setForeground(usedCpuPower > getComputerCpuPower() ? TangoColorFactory.SCARLET_3 : Color.BLACK); cpuPowerField.setEnabled(used); memoryField.setText(usedMemory + " GB / " + getComputerMemory() + " GB"); memoryField.setForeground(usedMemory > getComputerMemory() ? TangoColorFactory.SCARLET_3 : Color.BLACK); memoryField.setEnabled(used); networkBandwidthField.setText(usedNetworkBandwidth + " GB / " + getComputerNetworkBandwidth() + " GB"); networkBandwidthField.setForeground(usedNetworkBandwidth > getComputerNetworkBandwidth() ? TangoColorFactory.SCARLET_3 : Color.BLACK); networkBandwidthField.setEnabled(used); costField.setEnabled(used); }
void updateActivityStatus() { boolean isActive = clock.isActive(); displayInput.setEditable(editable && !isActive); displayInput.getTextField().setForeground(isActive ? ACTIVE_CLOCK_COLOR : INACTIVE_CLOCK_COLOR); startPauseButton.setToolTipText(isActive ? "Pause " + clockType : "Start " + clockType); startPauseButton.setIcon(isActive ? ClockTabPanel.PAUSE_ICON : ClockTabPanel.START_ICON); if (editable && clock.getDisplayTime() == 0 && !isActive) { displayInput.getTextField().setForeground(ColorScheme.PROGRESS_ERROR_COLOR.darker()); } }
private void updateTotals() { boolean used = processAssignmentList.size() > 0; machineLabel.setEnabled(used); for (MrResource resource : resourceList) { JTextField resourceField = resourceFieldMap.get(resource); long maximumCapacity; long safetyCapacity; if (machine != null) { MrMachineCapacity machineCapacity = machine.getMachineCapacity(resource); maximumCapacity = machineCapacity.getMaximumCapacity(); safetyCapacity = machineCapacity.getSafetyCapacity(); } else { maximumCapacity = 0L; safetyCapacity = 0L; } long usedTotal = 0L; for (MrProcessAssignment processAssignment : processAssignmentList) { usedTotal += processAssignment.getProcess().getProcessRequirement(resource).getUsage(); } resourceField.setText(usedTotal + " / " + maximumCapacity); resourceField.setForeground(usedTotal > maximumCapacity ? TangoColorFactory.SCARLET_3 : (usedTotal > safetyCapacity ? TangoColorFactory.ORANGE_3 : Color.BLACK)); resourceField.setEnabled(used); } numberOfProcessesLabel.setText(processAssignmentList.size() + " processes "); numberOfProcessesLabel.setEnabled(used); }
scoreField = new JTextField("Score:"); scoreField.setEditable(false); scoreField.setForeground(Color.BLACK); scoreField.setBorder(BorderFactory.createLoweredBevelBorder()); scorePanel.add(scoreField, BorderLayout.CENTER);
nameInput.setBackground(ColorScheme.DARKER_GRAY_COLOR); nameInput.setPreferredSize(new Dimension(0, 24)); nameInput.getTextField().setForeground(Color.WHITE); nameInput.getTextField().setBorder(new EmptyBorder(0, 8, 0, 0));
btnGenDeck.addActionListener(evt -> btnGenDeckActionPerformed(evt)); txtTimeRemaining.setEditable(false); txtTimeRemaining.setForeground(java.awt.Color.red); txtTimeRemaining.setHorizontalAlignment(javax.swing.JTextField.CENTER); txtTimeRemaining.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
txtTimeRemaining.setForeground(java.awt.Color.red); txtTimeRemaining.setHorizontalAlignment(javax.swing.JTextField.CENTER); txtTimeRemaining.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
hexField = new JTextField(); hexField.setFont(Theme.SMALL_BOLD_FONT); hexField.setForeground(Theme.TEXT_NORMAL_COLOR); hexField.setHorizontalAlignment(JTextField.CENTER); hexField.setBackground(null);
/** * Sets the foreground * * @param fg * the foreground */ @Override public void setForeground(final Color fg) { if (textField != null) { textField.setForeground(fg); } }
spinner.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { try { String colorString = (String)spinner.getValue(); Field field = Class.forName("java.awt.Color").getField(colorString.toLowerCase()); // toLowerCase because the color fields are RED or red, not Red Color color = (Color)field.get(null); JTextField tf = ((JSpinner.DefaultEditor) spinner.getEditor()).getTextField(); tf.setForeground(color); } catch (Exception ex) { // handle ex } } });
public void focusGained(FocusEvent e) { if (searchField.getText().equals(Res.getString("message.search.for.history"))) { searchField.setText(""); } searchField.setForeground((Color) UIManager .get("TextField.foreground")); }
public void focusLost(FocusEvent e) { searchField.setForeground((Color) UIManager .get("TextField.lightforeground")); if (searchField.getText().length() <= 1) { searchField.setText(Res.getString("message.search.for.history")); } } });
/** * here: set textfield colors to normal. */ @Override protected void showFoundMessage() { //JW: quick hack around #487-swingx - NPE in setSearchable if (searchField == null) return; searchField.setBackground(previousBackgroundColor); searchField.setForeground(previousForegroundColor); }
private void setJTextFieldColor(final JTextField tf, boolean isFloat) { if(!isFloat && (getIntValue(tf) > -1 || isVariableValue(tf))) { tf.setForeground(Color.black); } else if(isFloat && (getFloatValue(tf) > -1 || isVariableValue(tf))) { tf.setForeground(Color.black); } else { tf.setForeground(Color.red); } }
public void mouseClicked(MouseEvent e) { if (newSearch) { findField.setText(""); findField.getTextComponent().setForeground((Color) UIManager.get("TextField.foreground")); newSearch = false; } } });
@Override public void setForeground(Color color) { if(renderer == null) super.setForeground(color); else { renderer.setForeground(color); textField.setForeground(color); } }
public void focusLost(FocusEvent e) { findField.getTextComponent().setForeground((Color) UIManager.get("TextField.lightforeground")); findField.setText(searchable.getDefaultText()); } });