javax.swing.JButton.setOpaque()方法的使用及代码示例

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

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

JButton.setOpaque介绍

暂无

代码示例

代码示例来源:origin: pedrovgs/AndroidWiFiADB

public ConnectDisconnectPanel() {
 setLayout(new GridBagLayout());
 setOpaque(false);
 connect = new JButton(ACTION_CONNECT);
 connect.setActionCommand(ACTION_CONNECT);
 connect.setOpaque(false);
 disconnect = new JButton(ACTION_DISCONNECT);
 disconnect.setActionCommand(ACTION_DISCONNECT);
 disconnect.setOpaque(false);
 add(connect);
 add(disconnect);
}

代码示例来源:origin: stackoverflow.com

JButton button = new JButton("test");
button.setBackground(Color.RED);
button.setOpaque(true);

代码示例来源:origin: stackoverflow.com

JButton button = new JButton();
button.setBackground(Color.red);
button.setOpaque(true);
button.setBorderPainted(false);

代码示例来源:origin: skylot/jadx

button.setRolloverIcon(ICON_CLOSE);
button.setRolloverEnabled(true);
button.setOpaque(false);
button.setUI(new BasicButtonUI());
button.setContentAreaFilled(false);

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

private Component createButtons() {
  Action[] actions = primaryActions();
  JPanel buttons = createPanel(new GridLayout(1, actions.length, 3, 0));
  for(Action action : actions) {
    injector.injectMembers(action);
    JButton button = new JButton(action);
    button.setOpaque(false);
    button.setUI(SexyButtonUI.INSTANCE);
    buttons.add(button);
  }
  return buttons;
}

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

private JButton createButton() {
  JButton button = new JButton();
  button.setModel(buttonModel);
  button.setUI(new GaugeButtonUI());
  button.setOpaque(false);
  button.setPreferredSize(BUTTON_SIZE);
  button.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      buttonModel.turnNextLightOn();
      turnAllLightsOffIfAllAreOn();
    }
  });
  return button;
}

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

@Override
public void installUI(JComponent component) {
  super.installUI(component);
  JButton button = (JButton)component;
  button.setSize(new Dimension(17, 16));
  button.setOpaque(false);
  button.setBorderPainted(false);
}

代码示例来源:origin: winder/Universal-G-Code-Sender

@Override
public void statusStringListener(ControllerStatus status) {
  if (status.getOverrides() != null) {
    this.feedSpeed.setText(status.getOverrides().feed + "%");
    this.spindleSpeed.setText(status.getOverrides().spindle + "%");
    this.rapidSpeed.setText(status.getOverrides().rapid + "%");
  }
  if (status.getAccessoryStates() != null) {
    AccessoryStates states = status.getAccessoryStates();
    toggleSpindle.setBackground((states.SpindleCW || states.SpindleCCW) ? Color.GREEN : Color.RED);
    toggleFloodCoolant.setBackground(states.Flood ? Color.GREEN : Color.RED);
    toggleMistCoolant.setBackground(states.Mist ? Color.GREEN : Color.RED);
    toggleSpindle.setOpaque(true);
    toggleFloodCoolant.setOpaque(true);
    toggleMistCoolant.setOpaque(true);
  }
}

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

JButton buttonShowConsoles = new BasicArrowButton(SwingConstants.NORTH);
buttonShowConsoles.setBorderPainted(false);
buttonShowConsoles.setOpaque(false);

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

buttonRequestMethod.setOpaque(false);

代码示例来源:origin: magefree/mage

jButtonFooterNext.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
jButtonFooterNext.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
jButtonFooterNext.setOpaque(false);
jButtonFooterNext.addActionListener(evt -> jButtonFooterNextActionPerformed(evt));
jPanelBottom.add(jButtonFooterNext);

代码示例来源:origin: stackoverflow.com

JButton buttonForPicture = new JButton();
buttonForPicture.setBorder(new EmptyBorder(0, 0, 0, 0));
buttonForPicture.setOpaque(false);
buttonForPicture.setIcon(new ImageIcon(imageFilePath));
panel5.add(buttonForPicture);

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction
@Override
public void setOpaque(boolean aValue) {
  super.setOpaque(aValue);
}

代码示例来源:origin: net.sf.nimrod/nimrod-laf

protected JButton createLeftOneTouchButton() {
 JButton b = new Boton( Boton.IZQ, super.splitPane, BasicSplitPaneDivider.ONE_TOUCH_SIZE);
 Boolean boo = ((Boolean)UIManager.get( "SplitPane.oneTouchButtonsOpaque"));
 if ( boo != null ) {
  b.setOpaque( boo.booleanValue());
 }
 
 return b;
}

代码示例来源:origin: org.trypticon.hex/hex-viewer

private void setCommonButtonProperties(JButton button) {
  button.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4));
  button.setBorderPainted(false);
  button.setOpaque(false);
  button.setContentAreaFilled(false);
  button.setFocusPainted(false);
  button.setOpaque(false);
}

代码示例来源:origin: cytoscape.coreplugins/manual-layout

protected JButton createJButton(Action a, String tt) {
    JButton b = new JButton(a);
    b.setToolTipText(tt);
    b.setPreferredSize(new Dimension(27, 18));
    b.setMaximumSize(new Dimension(27, 18));
    b.setBorder(BorderFactory.createEmptyBorder());
    b.setBorderPainted(false);
    b.setOpaque(false);
    b.setContentAreaFilled(false);

    return b;
  }
}

代码示例来源:origin: org.cytoscape/manual-layout-impl

protected JButton createJButton(Action a, String tt) {
    JButton b = new JButton(a);
    b.setToolTipText(tt);
    b.setPreferredSize(new Dimension(27, 18));
    b.setMaximumSize(new Dimension(27, 18));
    b.setBorder(BorderFactory.createEmptyBorder());
    b.setBorderPainted(false);
    b.setOpaque(false);
    b.setContentAreaFilled(false);

    return b;
  }
}

代码示例来源:origin: org.cytoscape/manual-layout-impl

protected JButton createJButton(Action a, String tt) {
    JButton b = new JButton(a);
    b.setToolTipText(tt);
    b.setPreferredSize(new Dimension(27, 18));
    b.setMaximumSize(new Dimension(27, 18));
    b.setBorder(BorderFactory.createEmptyBorder());
    b.setBorderPainted(false);
    b.setOpaque(false);
    b.setContentAreaFilled(false);

    return b;
  }
}

代码示例来源:origin: datacleaner/DataCleaner

public static JComponent createBackToWelcomeScreenButton(final ActionListener backButtonActionListener) {
  final ImageIcon icon = ImageManager.get().getImageIcon(IconUtils.ACTION_BACK);
  final JButton backButton = WidgetFactory.createDefaultButton(null, icon);
  backButton.setOpaque(false);
  backButton.setBorder(null);
  backButton.setMargin(new Insets(0, 0, 0, 0));
  backButton.addActionListener(backButtonActionListener);
  return backButton;
}

代码示例来源:origin: com.github.tornaia/aott-desktop-client-core

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);
  }
}

相关文章

JButton类方法