@Override public void mouseClicked(MouseEvent e) { RuneliteColorPicker colorPicker = new RuneliteColorPicker(SwingUtilities.windowForComponent(ConfigPanel.this), colorPickerBtn.getBackground(), cid.getItem().name(), cid.getAlpha() == null); colorPicker.setLocation(getLocationOnScreen()); colorPicker.setOnColorChange(c -> { colorPickerBtn.setBackground(c); colorPickerBtn.setText(ColorUtil.toHexColor(c).toUpperCase()); }); colorPicker.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { changeConfiguration(listItem, config, colorPicker, cd, cid); } }); colorPicker.setVisible(true); } });
@Override public void stateChanged(ChangeEvent e) { if (!coloredButton.getBackground().equals(color)) { notifyColorChanged(coloredButton.getBackground()); } } });
public void actionPerformed(ActionEvent e) { JButton button = (JButton)e.getSource(); color = button.getBackground(); repaint(); }
private class matrixButtonListener implements ActionListener { public void actionPerformed(ActionEvent e) { JButton btn = (JButton) (e.getSource()); if (btn.getBackground() == COLOR_NEUTRAL) { btn.setBackground(COLOR_PLAYER); } } }
@ScriptFunction(jsDoc = BACKGROUND_JSDOC) @Override public Color getBackground() { return super.getBackground(); }
void selectNode(MouseEvent e) { // try finding the node that's annotated, i.e., the selected button if (e.getSource() instanceof JButton) { JButton source = (JButton) e.getSource(); selection.add(source); buttonBackground = source.getBackground(); source.setBackground(selectedNodeColor); } }
`public void flipIt(JButton button){ if(button.getBackground().equals(Color.white)){ button.setBackground(Color.yellow); } else if (button.getBackground().equals(Color.yellow)){ button.setBackground(Color.white); } }'
/** * Initilizes the locale specific names for the days of the week. */ protected void init() { final JButton testButton = new JButton(); oldDayBackgroundColor = testButton.getBackground(); selectedColor = new Color(160, 160, 160); final Date date = calendar.getTime(); calendar = Calendar.getInstance(locale); calendar.setTime(date); drawDayNames(); drawDays(); }
@Override public void actionPerformed(ActionEvent e) { Object eventSource = e.getSource(); if (eventSource instanceof JButton) { JButton buttonClicked = (JButton) eventSource; Color bg = buttonClicked.getBackground(); if (bg.equals(Color.white)) { buttonClicked.setBackground(Color.yellow); } else if (bg.equals(Color.yellow)) { buttonClicked.setBackground(Color.white); } } }
@Override public void mouseEntered(MouseEvent e) { this.prevBorder = button.getBorder(); CompoundBorder compoundBorder = BorderFactory.createCompoundBorder( BorderFactory.createLineBorder(AppThemeColor.ADR_SELECTED_BORDER, 1), BorderFactory.createLineBorder(button.getBackground(), 3) ); button.setBorder(compoundBorder); button.setCursor(new Cursor(Cursor.HAND_CURSOR)); }
/** Unset any previously highlighted day */ private void clearDayActive() { JButton b; // First un-shade the previously-selected square, if any if (activeDay > 0) { b = labs[(leadGap+activeDay-1)/7][(leadGap+activeDay-1)%7]; b.setBackground(b0.getBackground()); b.repaint(); activeDay = -1; } }
public int getSelectedIndex() { int i = 0; for (final VerticalTab<?> tab : _tabs) { final JButton button = tab.getButton(); if (button.getForeground() == COLOR_SELECTED_FOREGROUND && button.getBackground() == COLOR_SELECTED_BACKGROUND) { return i; } i++; } return -1; }
@Override public void actionPerformed(ActionEvent e) { Color selectedColor = JColorChooser.showDialog(null, "Pick a color", button.getBackground()); if (selectedColor != null) { button.setBackground(selectedColor); } } });
/** Unset any previously highlighted day */ private void clearDayActive() { JButton b; // First un-shade the previously-selected square, if any if (activeDay > 0) { b = labs[(leadGap+activeDay)/7][(leadGap+activeDay)%7]; b.setBackground(b0.getBackground()); b.repaint(); activeDay = -1; } }
public static void openColorChooser(JButton button) { if (button != null) { Color newColor = JColorChooser.showDialog(button, Messages.getString("MeasureTool.pick_color"), button.getBackground()); //$NON-NLS-1$ if (newColor != null) { button.setBackground(newColor); } } } }
/** * Updates the drawing due to changes made on this panel. */ private void updateDrawing() { if (drawing != null) { drawing.willChange(); drawing.fireUndoableEditHappened( CANVAS_FILL_COLOR.setUndoable(drawing, colorButton.getBackground()) ); drawing.changed(); } }
public Color getBackground() { Color r; if(isEnabled()&&model.isRollover()&&BuLib.isMetal()) r=new ColorUIResource(192,192,208); else r=super.getBackground(); return r; }
public Color getBackground() { Color r; if(isEnabled()&&getModel().isRollover()&&BuLib.isMetal()) r=new ColorUIResource(192,192,208); else r=super.getBackground(); return r; } }
public Color getBackground() { Color r; if(isEnabled()&&getModel().isRollover()&&BuLib.isMetal()) r=new ColorUIResource(192,192,208); else r=super.getBackground(); return r; } }
BattleTable(final BattleModel model) { super(model); setDefaultRenderer(Object.class, new Renderer()); setRowHeight(UnitImageFactory.DEFAULT_UNIT_ICON_SIZE + 5); setBackground(new JButton().getBackground()); setShowHorizontalLines(false); getTableHeader().setReorderingAllowed(false); // getTableHeader().setResizingAllowed(false); } }