@Override public void mouseExited(MouseEvent mouseEvent) { clearButton.setForeground(ColorScheme.PROGRESS_ERROR_COLOR); textField.dispatchEvent(mouseEvent); } });
@Override public void mouseEntered(MouseEvent mouseEvent) { clearButton.setForeground(Color.PINK); textField.dispatchEvent(mouseEvent); }
private JButton createButton(Exam exam, Color color, String toolTip) { JButton button = SwingUtils.makeSmallButton(new JButton(new ExamAction(exam))); button.setBackground(color); button.setToolTipText(toolTip); if (exam instanceof FollowingExam) { button.setForeground(TangoColorFactory.ALUMINIUM_5); } return button; }
public void go() throws Exception { if(!no_channel && !use_state) channel.connect(cluster_name); mainFrame=new JFrame(); mainFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); panel=new DrawPanel(use_state); panel.setBackground(background_color); sub_panel=new JPanel(); mainFrame.getContentPane().add("Center", panel); clear_button=new JButton("Clear"); clear_button.setFont(default_font); clear_button.addActionListener(this); leave_button=new JButton("Leave"); leave_button.setFont(default_font); leave_button.addActionListener(this); sub_panel.add("South", clear_button); sub_panel.add("South", leave_button); mainFrame.getContentPane().add("South", sub_panel); mainFrame.setBackground(background_color); clear_button.setForeground(Color.blue); leave_button.setForeground(Color.blue); mainFrame.pack(); mainFrame.setLocation(15, 25); mainFrame.setBounds(new Rectangle(250, 250)); if(!no_channel && use_state) { channel.connect(cluster_name, null, state_timeout); } mainFrame.setVisible(true); setTitle(); }
mainFrame.getContentPane().add("South", sub_panel); mainFrame.setBackground(background_color); clear_button.setForeground(Color.blue); leave_button.setForeground(Color.blue); mainFrame.pack(); mainFrame.setLocation(15, 25);
public void addShiftAssignment(ShiftAssignment shiftAssignment) { Shift shift = shiftAssignment.getShift(); JPanel shiftPanel = shiftPanelMap.get(shift); JButton shiftAssignmentButton = SwingUtils.makeSmallButton(new JButton(new ShiftAssignmentAction(shiftAssignment))); shiftAssignmentButton.setEnabled(shiftPanel.isEnabled()); if (employee != null) { if (employee.getDayOffRequestMap().containsKey(shift.getShiftDate()) || employee.getShiftOffRequestMap().containsKey(shift)) { shiftAssignmentButton.setForeground(TangoColorFactory.SCARLET_1); } } Color color = nurseRosteringPanel.determinePlanningEntityColor(shiftAssignment, shift.getShiftType()); shiftAssignmentButton.setBackground(color); String toolTip = nurseRosteringPanel.determinePlanningEntityTooltip(shiftAssignment); shiftAssignmentButton.setToolTipText(toolTip); shiftPanel.add(shiftAssignmentButton); shiftPanel.repaint(); shiftAssignmentButtonMap.put(shiftAssignment, shiftAssignmentButton); }
clearButton.setPreferredSize(new Dimension(30, 0)); clearButton.setFont(FontManager.getRunescapeBoldFont()); clearButton.setForeground(ColorScheme.PROGRESS_ERROR_COLOR); clearButton.setBorder(null); clearButton.setBorderPainted(false);
for(int i=1;i<=9;i++) { JButton btn = new JButton(String.valueOf(i)); btn.setBackground(Color.BLACK); btn.setForeground(Color.GRAY); p3.add(btn); }
private static JButton createSimpleButton(String text) { JButton button = new JButton(text); button.setForeground(Color.BLACK); button.setBackground(Color.WHITE); Border line = new LineBorder(Color.BLACK); Border margin = new EmptyBorder(5, 15, 5, 15); Border compound = new CompoundBorder(line, margin); button.setBorder(compound); return button; }
JButton addBtn = new JButton("+"); addBtn.setBounds(x_pos, y_pos, 30, 25); addBtn.setBorder(new RoundedBorder(10)); //10 is the radius addBtn.setForeground(Color.BLUE);
@Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { if (hasFocus) { renderButton.setForeground(table.getForeground()); renderButton.setBackground(UIManager.getColor("Button.background")); } else if (isSelected) { renderButton.setForeground(table.getSelectionForeground()); renderButton.setBackground(table.getSelectionBackground()); } else { renderButton.setForeground(table.getForeground()); renderButton.setBackground(UIManager.getColor("Button.background")); } renderButton.setText((value == null) ? "" : value.toString()); return renderButton; }
public DataControl(String nodePath, Port port) { super(nodePath, port); setLayout(new BoxLayout(this, BoxLayout.LINE_AXIS)); clearDataButton = new JButton("Clear"); clearDataButton.setMargin(new Insets(1, 0, 0, 0)); clearDataButton.putClientProperty("JButton.buttonType", "textured"); clearDataButton.putClientProperty("JComponent.sizeVariant", "small"); clearDataButton.setFont(Theme.SMALL_BOLD_FONT); clearDataButton.setForeground(Theme.TEXT_NORMAL_COLOR); clearDataButton.addActionListener(this); add(clearDataButton); /*showDataButton = new JButton("Show Data..."); showDataButton.setMargin(new Insets(1, 0, 0, 0)); showDataButton.putClientProperty("JButton.buttonType", "textured"); showDataButton.putClientProperty("JComponent.sizeVariant", "small"); showDataButton.setFont(Theme.SMALL_BOLD_FONT); showDataButton.setForeground(Theme.TEXT_NORMAL_COLOR); showDataButton.addActionListener(this); add(showDataButton);*/ add(Box.createHorizontalGlue()); }
@Override public void setForeground(Color fg) { if (fg instanceof ColorUIResource) { return; } super.setForeground(fg); } }
@Override public void setForeground(Color fg) { if (fg != null) { super.setForeground(fg); } }
JButton aButton ... aButton.setBackground(new Color(...)); aButton.setForeground(new Color(...)); aButton.setFont(new Font(...)); aButton.setBorder(null);
void deactivateButtonToReturnToSuperTree() { _return_to_super_tree.setText( RETURN_TO_SUPER_TREE_TEXT ); _return_to_super_tree.setForeground( getConfiguration().getGuiButtonTextColor() ); _return_to_super_tree.setEnabled( false ); }
private void styleDatePickerArrowButtons(JButton jButton) { jButton.setFont(new JButton("").getFont().deriveFont(Font.PLAIN, 24)); jButton.setBackground(ColorConst.CONTENT_BACKGROUND); jButton.setForeground(ColorConst.SIDENAV_TITLE_FOREGROUND); jButton.setOpaque(false); jButton.setBorder(BorderFactory.createLineBorder(ColorConst.CONTENT_BACKGROUND)); jButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); jButton.setPreferredSize(new Dimension(26, 26)); jButton.setFocusable(false); } }
protected void openConnection() { NetworkConnection s = gui.requestNewConnection(); if(s!=null) { buttonConnect.setText(Translator.get("ButtonDisconnect")); buttonConnect.setForeground(Color.RED); robot.openConnection( s ); //updateMachineNumberPanel(); //updateButtonAccess(); isConnected=true; } }
private void updatePickColorButton() { Color color = colors.get(index); pickColor.setBackground(ColorUtils.makeNonTransparent(color)); final Color textColor = UITools.getTextColorForBackground(color); pickColor.setForeground(textColor); pickColor.setText(ColorUtils.colorToString(color)); } private void removeFromPanel() {
public void actionPerformed(ActionEvent e) { Color color = JColorChooser.showDialog( colorChooser, "Annotation Color", colorChooser.getForeground()); annotatingPlugin.setAnnotationColor(color); colorChooser.setForeground(color); } });