javax.swing.JCheckBox.setFocusPainted()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(9.6k)|赞(0)|评价(0)|浏览(163)

本文整理了Java中javax.swing.JCheckBox.setFocusPainted()方法的一些代码示例,展示了JCheckBox.setFocusPainted()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JCheckBox.setFocusPainted()方法的具体详情如下:
包路径:javax.swing.JCheckBox
类名称:JCheckBox
方法名:setFocusPainted

JCheckBox.setFocusPainted介绍

暂无

代码示例

代码示例来源:origin: ron190/jsql-injection

  1. radioCustomFromRow.setBorder(BorderFactory.createEmptyBorder(0, 6, 0, 0));
  2. radioCustomFromRow.setIcon(new CheckBoxMenuItemIconCustom());
  3. radioCustomFromRow.setFocusPainted(false);
  4. radioCustomToRow.setBorder(BorderFactory.createEmptyBorder(0, 6, 0, 0));
  5. radioCustomToRow.setIcon(new CheckBoxMenuItemIconCustom());
  6. radioCustomToRow.setFocusPainted(false);
  7. radioCustomFromChar.setBorder(BorderFactory.createEmptyBorder(0, 6, 0, 0));
  8. radioCustomFromChar.setIcon(new CheckBoxMenuItemIconCustom());
  9. radioCustomFromChar.setFocusPainted(false);
  10. radioCustomToChar.setBorder(BorderFactory.createEmptyBorder(0, 6, 0, 0));
  11. radioCustomToChar.setIcon(new CheckBoxMenuItemIconCustom());
  12. radioCustomToChar.setFocusPainted(false);

代码示例来源:origin: igvteam/igv

  1. public void setFocusPainted(boolean value) {
  2. if (jCheckBox1 != null) {
  3. jCheckBox1.setFocusPainted(value);
  4. }
  5. }

代码示例来源:origin: org.terracotta.modules/tim-ehcache-2.x-ui

  1. private void setFocusPainted(boolean focusPainted) {
  2. checkBox.setFocusPainted(focusPainted);
  3. }

代码示例来源:origin: Exslims/MercuryTrade

  1. public JCheckBox getCheckBox(boolean value) {
  2. JCheckBox checkBox = new JCheckBox();
  3. checkBox.setSelected(value);
  4. // checkBox.setUI(new WindowsButtonUI());
  5. checkBox.setFocusPainted(false);
  6. checkBox.setBackground(AppThemeColor.TRANSPARENT);
  7. return checkBox;
  8. }

代码示例来源:origin: org.gdl-lang.gdl-tools/openehr-utils-gui-swing

  1. public CheckBoxNodeRenderer() {
  2. Boolean booleanValue = (Boolean) UIManager.get("Tree.drawsFocusBorderAroundIcon");
  3. leafRenderer.setFocusPainted((booleanValue != null)
  4. && (booleanValue));
  5. leafRenderer.addActionListener(new CheckBoxNodeActionListener());
  6. selectionForeground = UIManager.getColor("Tree.selectionForeground");
  7. selectionBackground = UIManager.getColor("Tree.selectionBackground");
  8. textForeground = UIManager.getColor("Tree.textForeground");
  9. textBackground = UIManager.getColor("Tree.textBackground");
  10. }

代码示例来源:origin: org.scijava/swing-checkbox-tree

  1. public CheckBoxNodeRenderer() {
  2. final Font fontValue = UIManager.getFont("Tree.font");
  3. if (fontValue != null) panel.label.setFont(fontValue);
  4. final Boolean focusPainted =
  5. (Boolean) UIManager.get("Tree.drawsFocusBorderAroundIcon");
  6. panel.check.setFocusPainted(focusPainted != null && focusPainted);
  7. selectionForeground = UIManager.getColor("Tree.selectionForeground");
  8. selectionBackground = UIManager.getColor("Tree.selectionBackground");
  9. textForeground = UIManager.getColor("Tree.textForeground");
  10. textBackground = UIManager.getColor("Tree.textBackground");
  11. }

代码示例来源:origin: GoldenGnu/jeveassets

  1. public CheckBoxNodeRenderer() {
  2. Font fontValue;
  3. fontValue = UIManager.getFont("Tree.font");
  4. if (fontValue != null) {
  5. leafRenderer.setFont(fontValue);
  6. }
  7. Boolean booleanValue = (Boolean) UIManager.get("Tree.drawsFocusBorderAroundIcon");
  8. leafRenderer.setFocusPainted(booleanValue != null && booleanValue);
  9. selectionBorderColor = UIManager.getColor("Tree.selectionBorderColor");
  10. selectionForeground = UIManager.getColor("Tree.selectionForeground");
  11. selectionBackground = UIManager.getColor("Tree.selectionBackground");
  12. textForeground = UIManager.getColor("Tree.textForeground");
  13. textBackground = UIManager.getColor("Tree.textBackground");
  14. }

代码示例来源:origin: com.jalalkiswani/jk-desktop

  1. /**
  2. * Instantiates a new tree check box node renderer.
  3. */
  4. // ///////////////////////////////////////////////////////////////////////////////////////
  5. public TreeCheckBoxNodeRenderer() {
  6. Font fontValue;
  7. fontValue = UIManager.getFont("Tree.font");
  8. if (fontValue != null) {
  9. this.leafRenderer.setFont(fontValue);
  10. }
  11. final Boolean booleanValue = (Boolean) UIManager.get("Tree.drawsFocusBorderAroundIcon");
  12. this.leafRenderer.setFocusPainted(booleanValue != null && booleanValue.booleanValue());
  13. this.selectionBorderColor = UIManager.getColor("Tree.selectionBorderColor");
  14. this.selectionForeground = UIManager.getColor("Tree.selectionForeground");
  15. this.selectionBackground = UIManager.getColor("Tree.selectionBackground");
  16. this.textForeground = UIManager.getColor("Tree.textForeground");
  17. this.textBackground = UIManager.getColor("Tree.textBackground");
  18. }

代码示例来源:origin: gurkenlabs/litiengine

  1. public CheckBoxPanel(String text) {
  2. this.newCheck = new JCheckBox();
  3. this.newLabel = new JLabel(text);
  4. this.newCheck.setFocusPainted(false);
  5. this.newCheck.setBorderPainted(true);
  6. this.newLabel.setOpaque(true);
  7. this.newLabel.setFocusable(false);
  8. this.setLayout(new BorderLayout());
  9. this.add(newCheck, BorderLayout.WEST);
  10. this.add(newLabel, BorderLayout.CENTER);
  11. }

代码示例来源:origin: Exslims/MercuryTrade

  1. public JCheckBox getCheckBox(String tooltip) {
  2. JCheckBox checkBox = new JCheckBox();
  3. checkBox.setFocusPainted(false);
  4. checkBox.setBackground(AppThemeColor.TRANSPARENT);
  5. // checkBox.setUI(new WindowsButtonUI());
  6. checkBox.addMouseListener(new TooltipMouseListener(tooltip));
  7. return checkBox;
  8. }

代码示例来源:origin: robward-scisys/sldeditor

  1. /** Instantiates a new check box panel. */
  2. public CheckBoxPanel() {
  3. setOpaque(false);
  4. checkBox = new JCheckBox();
  5. checkBox.setMargin(new Insets(0, 0, 0, 0));
  6. label = new TreeLabel();
  7. setLayout(new BorderLayout());
  8. add(checkBox, BorderLayout.WEST);
  9. Border border = label.getBorder();
  10. Border margin = new EmptyBorder(0, 3, 0, 0);
  11. label.setBorder(new CompoundBorder(border, margin));
  12. add(label, BorderLayout.CENTER);
  13. Boolean booleanValue = (Boolean) UIManager.get("Tree.drawsFocusBorderAroundIcon");
  14. checkBox.setFocusPainted((booleanValue != null) && (booleanValue.booleanValue()));
  15. selectionForeground = UIManager.getColor("Tree.selectionForeground");
  16. textForeground = UIManager.getColor("Tree.textForeground");
  17. }

代码示例来源:origin: aterai/java-swing-tips

  1. check.setFocusPainted(false);

代码示例来源:origin: AliView/AliView

  1. JCheckBox cbx = new JCheckBox("Don't show this message again (can be undone in Preferences)");
  2. cbx.setSelected(cbxSelected);
  3. cbx.setFocusPainted(false);
  4. JOptionPane optPane = new JOptionPaneWithCheckbox(cbx, message.text,JOptionPane.INFORMATION_MESSAGE, optionType);
  5. optPane.addPropertyChangeListener(new PropertyChangeListener()

代码示例来源:origin: org.biojava.thirdparty/forester

  1. void addJCheckBox( final JCheckBox jcb, final JPanel p ) {
  2. jcb.setFocusPainted( false );
  3. jcb.setFont( ControlPanel.jcb_font );
  4. if ( !_configuration.isUseNativeUI() ) {
  5. jcb.setBackground( getConfiguration().getGuiBackgroundColor() );
  6. jcb.setForeground( getConfiguration().getGuiCheckboxTextColor() );
  7. }
  8. p.add( jcb, "Center" );
  9. jcb.addActionListener( this );
  10. }

代码示例来源:origin: tulskiy/musique

  1. singleInstance.setFocusPainted(false);
  2. singleInstance.setMargin(new java.awt.Insets(2, -1, 2, 2));
  3. enableTray.setFocusPainted(false);
  4. minimizeOnClose.setFocusPainted(false);
  5. showSideBar.setFocusPainted(false);
  6. searchLyrics.setFocusPainted(false);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mobility-cldcplatform

  1. usePreverify.setFocusPainted(false);
  2. usePreverify.addActionListener(new java.awt.event.ActionListener() {
  3. public void actionPerformed(java.awt.event.ActionEvent evt) {

代码示例来源:origin: locationtech/jts

  1. public Component getListCellRendererComponent(JList list, Object value,
  2. int index, boolean isSelected, boolean cellHasFocus) {
  3. Layer lyr = (Layer) value;
  4. checkbox.setBackground(isSelected ? getSelectionBackground()
  5. : getBackground());
  6. checkbox.setForeground(isSelected ? getSelectionForeground()
  7. : getForeground());
  8. checkbox.setSelected(lyr.isEnabled());
  9. checkbox.setEnabled(isEnabled());
  10. checkbox.setFont(getFont());
  11. checkbox.setFocusPainted(false);
  12. checkbox.setBorderPainted(true);
  13. checkbox.setBorder(isSelected ? UIManager
  14. .getBorder("List.focusCellHighlightBorder") : noFocusBorder);
  15. checkbox.setText(lyr.getNameInfo());
  16. return checkbox;
  17. }
  18. }

代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2

  1. public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
  2. JCheckBox checkbox = (JCheckBox) value;
  3. checkbox.setBackground(isSelected ? getSelectionBackground() : getBackground());
  4. checkbox.setForeground(isSelected ? getSelectionForeground() : getForeground());
  5. checkbox.setEnabled(isEnabled());
  6. checkbox.setFont(getFont());
  7. checkbox.setFocusPainted(false);
  8. checkbox.setBorderPainted(false);
  9. return checkbox;
  10. }
  11. }

代码示例来源:origin: gurkenlabs/litiengine

  1. @Override
  2. public Component getListCellRendererComponent(JList<? extends JCheckBox> list, JCheckBox value, int index, boolean isSelected, boolean cellHasFocus) {
  3. if(!this.panels.containsKey(value)) {
  4. this.panels.put(value, new CheckBoxPanel(value.getText()));
  5. }
  6. CheckBoxPanel panel = this.panels.get(value);
  7. panel.getCheck().setSelected(value.isSelected());
  8. // Drawing checkbox, change the appearance here
  9. panel.getCheck().setBackground(isSelected ? getSelectionBackground() : getBackground());
  10. panel.getCheck().setForeground(isSelected ? getSelectionForeground() : getForeground());
  11. panel.getCheck().setEnabled(isEnabled());
  12. panel.getCheck().setFont(getFont());
  13. panel.getCheck().setFocusPainted(false);
  14. panel.getCheck().setBorderPainted(true);
  15. panel.getCheck().setBorder(isSelected ? UIManager.getBorder("List.focusCellHighlightBorder") : noFocusBorder);
  16. panel.getLabel().setOpaque(true);
  17. panel.getLabel().setBackground(isSelected ? getSelectionBackground() : getBackground());
  18. panel.getLabel().setForeground(isSelected ? getSelectionForeground() : getForeground());
  19. panel.getLabel().setEnabled(isEnabled());
  20. panel.getLabel().setFocusable(false);
  21. panel.getLabel().setFont(getFont());
  22. panel.getLabel().setBorder(isSelected ? UIManager.getBorder("List.focusCellHighlightBorder") : noFocusBorder);
  23. panel.getLabel().setIcon(value.getIcon());
  24. return panel;
  25. }

相关文章

JCheckBox类方法