small3x3.setForeground(Color.white); boolean selected3x3 = MageFrame.getPreferences().get(LAYOYT_CONFIG_KEY, MageBook.LAYOUT_3x3).equals(MageBook.LAYOUT_3x3); small3x3.setSelected(selected3x3); big4x4.setForeground(Color.white); big4x4.setSelected(!selected3x3); big4x4.addActionListener(e -> {
@Override public void setForeground(Color fg) { if (fg instanceof ColorUIResource) { return; } super.setForeground(fg); } }
public void setForeground(Color c) { super.setForeground(c); unselectedForeground = c; }
JRadioButton rMaintain = new JRadioButton("Maintenance"); rInstall.setForeground(Color.white); rInstall.setOpaque(false); rProject.setForeground(Color.white); rProject.setOpaque(false); rMaintain.setForeground(Color.white); rMaintain.setOpaque(false);
private void clearAttribute() { super.setFont(null); super.setBackground(null); super.setForeground(null); }
private JRadioButton createOptionRadioButton(String text, Icon checkboxIcon, Icon checkboxSelectedIcon) { JRadioButton radioButton = new JRadioButton(text); radioButton.setOpaque(false); radioButton.setForeground(new Color(150, 220, 255)); radioButton.setFocusable(false); radioButton.setFont(radioButton.getFont().deriveFont(Font.BOLD)); radioButton.setPreferredSize(new Dimension(150, 20)); radioButton.setIcon(checkboxIcon); radioButton.setSelectedIcon(checkboxSelectedIcon); radioButton.setSelected(false); radioButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { repaint(); } }); return radioButton; }
option.setForeground(ColorController.COR_LETRA); option2.setForeground(ColorController.COR_LETRA);
radio2.setEnabled(enableUseExisting); if (!enableUseExisting) { radio2.setForeground(UIManager.getColor("RadioButton.disabledText")); radio3.setEnabled(enableRestorePassword); if (!enableRestorePassword) { radio3.setForeground(UIManager.getColor("RadioButton.disabledText"));
rbLuminance.setForeground(new java.awt.Color(255, 255, 255)); rbLuminance.setText(org.openide.util.NbBundle.getMessage(UniformityCheckMainPanel.class, "UniformityCheckMainPanel.rbLuminance.text")); // NOI18N rbLuminance.setName(org.openide.util.NbBundle.getMessage(UniformityCheckMainPanel.class, "UniformityCheckMainPanel.rbLuminance.name")); // NOI18N rbWhitePoint.setForeground(new java.awt.Color(255, 255, 255)); rbWhitePoint.setText(org.openide.util.NbBundle.getMessage(UniformityCheckMainPanel.class, "UniformityCheckMainPanel.rbWhitePoint.text")); // NOI18N rbWhitePoint.setName(org.openide.util.NbBundle.getMessage(UniformityCheckMainPanel.class, "UniformityCheckMainPanel.rbWhitePoint.name")); // NOI18N
rbLuminance.setForeground(new java.awt.Color(255, 255, 255)); rbLuminance.setText(org.openide.util.NbBundle.getMessage(UniformityCheckMainPanel.class, "UniformityCheckMainPanel.rbLuminance.text")); // NOI18N rbLuminance.setName(org.openide.util.NbBundle.getMessage(UniformityCheckMainPanel.class, "UniformityCheckMainPanel.rbLuminance.name")); // NOI18N rbWhitePoint.setForeground(new java.awt.Color(255, 255, 255)); rbWhitePoint.setText(org.openide.util.NbBundle.getMessage(UniformityCheckMainPanel.class, "UniformityCheckMainPanel.rbWhitePoint.text")); // NOI18N rbWhitePoint.setName(org.openide.util.NbBundle.getMessage(UniformityCheckMainPanel.class, "UniformityCheckMainPanel.rbWhitePoint.name")); // NOI18N
radio2.setEnabled(enableUseExisting); if (!enableUseExisting) { radio2.setForeground(UIManager.getColor("RadioButton.disabledText")); radio3.setEnabled(enableRestore); if (!enableRestore) { radio3.setForeground(UIManager.getColor("RadioButton.disabledText"));
@Override public void installUI (JComponent c) { super.installUI (c); JRadioButton radioButton = (JRadioButton) c; radioButton.setFont (UIManager.getFont ("RadioButton.font")); radioButton.setBackground (UIManager.getColor ("RadioButton.background")); radioButton.setForeground (UIManager.getColor ("RadioButton.foreground")); radioButton.setIcon (UIManager.getIcon ("RadioButton.icon")); radioButton.setSelectedIcon (UIManager.getIcon ("RadioButton.selectedIcon")); }
/** * @param key The resource key for the language string * @param values The values to apply to the string (can be null) * * @return A new JButton with default styling */ public static JRadioButton newRadioButton(MessageKey key, Object... values) { JRadioButton radio = new JRadioButton(); radio.setText(Languages.safeText(key, values)); // Ensure it is accessible AccessibilityDecorator.apply(radio, key); // Apply the current theme radio.setForeground(Themes.currentTheme.text()); // Reinforce the idea of clicking radio.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); // Ensure we use the correct component orientation radio.applyComponentOrientation(Languages.currentComponentOrientation()); return radio; }
this.setSelected(b); if (isSelected) { super.setForeground(table.getSelectionForeground()); super.setBackground(table.getSelectionBackground()); this.panel.setForeground(table.getSelectionForeground()); this.panel.setBackground(table.getSelectionBackground()); } else { super.setForeground((unselectedForeground != null) ? unselectedForeground : table.getForeground()); super.setBackground((unselectedBackground != null) ? unselectedBackground col = UIManager.getColor("Table.focusCellForeground"); // NOI18N if (col != null) { super.setForeground(col);
@Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { if (value == null) { return null; } int selectedRow = table.getSelectedRow(); if (selectedRow != -1) { JRadioButton selectedButton = (JRadioButton) table.getValueAt(selectedRow, 0); if (!selectedButton.isSelected()) { selectedButton.doClick(); } } JRadioButton button = (JRadioButton) value; button.setForeground(isSelected ? table.getSelectionForeground() : table.getForeground()); button.setBackground(isSelected ? table.getSelectionBackground() : table.getBackground()); // long millis = System.currentTimeMillis() % 100000; // System.out.printf("%1$5d: row: %2$d; isSelected: %3$5b; buttonSelected: %4$5b; selectedRow: %5$d%n", millis, row, isSelected, button.isSelected(), selectedRow); return button; } };
private JRadioButton getRadioButton( String string, String enString, boolean selected ) { string = Common.getStringUsingDefaultLanguage( string, enString ); // 使用預設語言 JRadioButton radioButton = new JRadioButton( string, selected ); //button.setFont( SetUp.getDefaultFont() ); if ( SetUp.getUsingBackgroundPicOfChoiceFrame() ) { // 若設定為透明,就用預定字體。 radioButton.setOpaque( false ); radioButton.setForeground( SetUp.getChoiceFrameOtherDefaultColor() ); radioButton.addMouseListener( this ); } radioButton.addItemListener( new ItemHandler() ); if ( SetUp.getSkinClassName().matches( ".*napkin.*" ) ) { // 因為napkin的預設字型不太清楚,所以用選定字型 radioButton.setFont( SetUp.getDefaultFont( - 2 ) ); } return radioButton; } }
private JRadioButton getRadioButton( String string, String enString, boolean selected ) { string = Common.getStringUsingDefaultLanguage( string, enString ); // 使用預設語言 JRadioButton radioButton = new JRadioButton( string, selected ); radioButton.setFont( SetUp.getDefaultFont() ); if ( SetUp.getUsingBackgroundPicOfChoiceFrame() ) { // 若設定為透明,就用預定字體。 radioButton.setOpaque( false ); radioButton.setForeground( SetUp.getChoiceFrameOtherDefaultColor() ); radioButton.addMouseListener( this ); } radioButton.addItemListener( new ItemHandler() ); if ( SetUp.getSkinClassName().matches( ".*napkin.*" ) ) { // 因為napkin的預設字型不太清楚,所以用選定字型 radioButton.setFont( SetUp.getDefaultFont( - 2 ) ); } return radioButton; }
public static void configuraWebLaf(JRadioButton field) { if (!WeblafUtils.weblafEstaInstalado()) { return; } ((WebRadioButtonUI) field.getUI()).setBorderColor(ColorController.COR_PRINCIPAL); ((WebRadioButtonUI) field.getUI()).setDarkBorderColor(ColorController.COR_PRINCIPAL); ((WebRadioButtonUI) field.getUI()).setShadeWidth(0); ((WebRadioButtonUI) field.getUI()).setBottomBgColor(ColorController.COR_PRINCIPAL); ((WebRadioButtonUI) field.getUI()).setTopBgColor(ColorController.COR_PRINCIPAL); ((WebRadioButtonUI) field.getUI()).setBottomSelectedBgColor(ColorController.COR_DESTAQUE); ((WebRadioButtonUI) field.getUI()).setTopSelectedBgColor(ColorController.COR_DESTAQUE); field.setOpaque(false); field.setForeground(ColorController.COR_LETRA); }
substituirLabel.setForeground(ColorController.COR_LETRA); procurarLabel.setForeground(ColorController.COR_LETRA); avancarRadioButton.setForeground(ColorController.COR_LETRA); voltarRadioButton.setForeground(ColorController.COR_LETRA); if(WeblafUtils.weblafEstaInstalado())