javax.swing.JToggleButton.addActionListener()方法的使用及代码示例

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

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

JToggleButton.addActionListener介绍

暂无

代码示例

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

activeButton.addActionListener(new ActionListener() {
  public void actionPerformed (ActionEvent event) {
    activate();
advancedButton.addActionListener(new ActionListener() {
  public void actionPerformed (ActionEvent event) {
    advancedPanel.setVisible(advancedButton.isSelected());

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

activeButton.addActionListener(new ActionListener() {
  public void actionPerformed (ActionEvent event) {
    activate();
advancedButton.addActionListener(new ActionListener() {
  public void actionPerformed (ActionEvent event) {
    advancedPanel.setVisible(advancedButton.isSelected());

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

activeButton.addActionListener(new ActionListener() {
  public void actionPerformed (ActionEvent event) {
    updateActive();
advancedButton.addActionListener(new ActionListener() {
  public void actionPerformed (ActionEvent event) {
    advancedPanel.setVisible(advancedButton.isSelected());

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

activeButton.addActionListener(new ActionListener() {
  public void actionPerformed (ActionEvent event) {
    updateActive();
advancedButton.addActionListener(new ActionListener() {
  public void actionPerformed (ActionEvent event) {
    advancedPanel.setVisible(advancedButton.isSelected());

代码示例来源:origin: kiegroup/optaplanner

indictmentHeatMapToggleButton.setEnabled(false);
indictmentHeatMapToggleButton.setToolTipText("Show indictment heat map");
indictmentHeatMapToggleButton.addActionListener(e -> {
  boolean selected = indictmentHeatMapToggleButton.isSelected();
  indictmentHeatMapToggleButton.setIcon(selected ?
refreshScreenDuringSolvingToggleButton = new JToggleButton(refreshScreenDuringSolvingTrueIcon, true);
refreshScreenDuringSolvingToggleButton.setToolTipText("Refresh screen during solving");
refreshScreenDuringSolvingToggleButton.addActionListener(e -> {
  refreshScreenDuringSolvingToggleButton.setIcon(refreshScreenDuringSolvingToggleButton.isSelected() ?
      refreshScreenDuringSolvingTrueIcon : refreshScreenDuringSolvingFalseIcon);

代码示例来源:origin: org.codehaus.groovy/groovy

JToggleButton tokenButton = new JToggleButton((String) tokens.get(Integer.valueOf(token.getType())));
bg.add(tokenButton);
tokenButton.addActionListener(this);
tokenButton.setToolTipText(token.getText());
tokenButton.putClientProperty("token", token);

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

ActionListener flatPkgAction = e -> toggleFlattenPackage();
flatPkgMenuItem.addActionListener(flatPkgAction);
flatPkgButton.addActionListener(flatPkgAction);
flatPkgButton.setToolTipText(NLS.str("menu.flatten"));

代码示例来源:origin: 4thline/cling

toggleButton.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent e) {
    presenter.onSwitchToggle(toggleButton.isSelected());

代码示例来源:origin: 4thline/cling

muteButton.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent e) {
    presenter.onMuteSelected(getInstanceId(), muteButton.isSelected());

代码示例来源:origin: chewiebug/GCViewer

public void initGCViewerGui(GCViewerGui gui, GCModelLoaderController controller) {
  Image iconImage = ImageHelper.loadImage("gcviewericon.gif");
  gui.setIconImage(iconImage);
  Map<String, Action> actionMap = initActionMap(controller, gui, iconImage);
  GCViewerGuiMenuBar menuBar = initMenuBar(actionMap, gui, controller);
  GCViewerGuiToolBar toolBar = initToolBar(actionMap);
  JDesktopPane desktopPane = initDesktopPane(gui, controller);
  
  WatchStateController wsListener = new WatchStateController(menuBar.getWatchMenuItem(), toolBar.getWatchToggleButton());
  menuBar.getWatchMenuItem().addActionListener(wsListener);
  toolBar.getWatchToggleButton().addActionListener(wsListener);
  
  gui.setActionMap(actionMap);
  gui.setJMenuBar(menuBar);
  gui.setToolBar(toolBar);
  gui.setDesktopPane(desktopPane);
}

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

jToggleListView.setMinimumSize(new java.awt.Dimension(37, 25));
jToggleListView.setPreferredSize(new java.awt.Dimension(44, 22));
jToggleListView.addActionListener(evt -> jToggleListViewActionPerformed(evt));
jToggleCardView.setMargin(new java.awt.Insets(2, 6, 2, 6));
jToggleCardView.setPreferredSize(new java.awt.Dimension(40, 22));
jToggleCardView.addActionListener(evt -> jToggleCardViewActionPerformed(evt));

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

sortMode.add(button);
sortModeGroup.add(button);
button.addActionListener(e -> {
  cardSort = s;
  PreferencesDialog.saveValue(PreferencesDialog.KEY_DECK_EDITOR_LAST_SORT, s.toString());
  selectByTypeMode.add(multiplesButton);
  selectByTypeModeGroup.add(multiplesButton);
  multiplesButton.addActionListener(e -> {
    multiplesButton.setSelected(!multiplesButton.isSelected());
    reselectBy();
selectByTypeMode.add(button);
selectByTypeModeGroup.add(button);
button.addActionListener(e -> {

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

tbRed.setSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/color_red.png"))); // NOI18N
tbRed.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
tbRed.addActionListener(new java.awt.event.ActionListener() {
  public void actionPerformed(java.awt.event.ActionEvent evt) {
    tbRedActionPerformed(evt);
tbGreen.setVerifyInputWhenFocusTarget(false);
tbGreen.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
tbGreen.addActionListener(new java.awt.event.ActionListener() {
  public void actionPerformed(java.awt.event.ActionEvent evt) {
    tbGreenActionPerformed(evt);
tbBlue.setSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/color_blue.png"))); // NOI18N
tbBlue.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
tbBlue.addActionListener(new java.awt.event.ActionListener() {
  public void actionPerformed(java.awt.event.ActionEvent evt) {
    tbBlueActionPerformed(evt);
tbBlack.setSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/color_black.png"))); // NOI18N
tbBlack.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
tbBlack.addActionListener(new java.awt.event.ActionListener() {
  public void actionPerformed(java.awt.event.ActionEvent evt) {
    tbBlackActionPerformed(evt);
tbWhite.setSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/color_white.png"))); // NOI18N
tbWhite.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
tbWhite.addActionListener(new java.awt.event.ActionListener() {
  public void actionPerformed(java.awt.event.ActionEvent evt) {
    tbWhiteActionPerformed(evt);

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

btnStateWaiting.setVerifyInputWhenFocusTarget(false);
btnStateWaiting.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
btnStateWaiting.addActionListener(evt -> btnFilterActionPerformed(evt));
filterBar1.add(btnStateWaiting);
btnStateActive.setVerifyInputWhenFocusTarget(false);
btnStateActive.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
btnStateActive.addActionListener(evt -> btnFilterActionPerformed(evt));
filterBar1.add(btnStateActive);
btnStateFinished.setVerifyInputWhenFocusTarget(false);
btnStateFinished.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
btnStateFinished.addActionListener(evt -> btnStateFinishedActionPerformed(evt));
filterBar1.add(btnStateFinished);
filterBar1.add(jSeparator1);
btnTypeMatch.setVerifyInputWhenFocusTarget(false);
btnTypeMatch.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
btnTypeMatch.addActionListener(evt -> btnFilterActionPerformed(evt));
filterBar1.add(btnTypeMatch);
btnTypeTourneyConstructed.setRequestFocusEnabled(false);
btnTypeTourneyConstructed.setVerifyInputWhenFocusTarget(false);
btnTypeTourneyConstructed.addActionListener(evt -> btnFilterActionPerformed(evt));
filterBar1.add(btnTypeTourneyConstructed);
btnTypeTourneyLimited.setRequestFocusEnabled(false);
btnTypeTourneyLimited.setVerifyInputWhenFocusTarget(false);
btnTypeTourneyLimited.addActionListener(evt -> btnFilterActionPerformed(evt));

代码示例来源:origin: pentaho/mondrian

getResourceConverter().getString(
    "schemaExplorer.actionEdit.title", "Edit Mode"));
editModeButton.addActionListener(editMode);

代码示例来源:origin: robo-code/robocode

/**
 * Returns the Paint button.
 *
 * @return the Paint button
 */
private JToggleButton getPaintButton() {
  if (paintButton == null) {
    paintButton = new JToggleButton("Paint");
    paintButton.addActionListener(eventHandler);
  }
  return paintButton;
}

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

private JToggleButton createNodePositionToggleButton(String key, final NodePosition position) {
  final JToggleButton btn = TranslatedElementFactory.createToggleButtonWithIcon(key + ".icon", key + ".tooltip");
  btn.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      UndoableSlide.of(slide).setPlacedNodePosition(position);
    }
  });
  nodePositions.add(btn);
  return btn;
}

代码示例来源:origin: com.projectdarkstar.example.projectsnowman/snowman-world-editor

private void addButton(Enum e) {
  JToggleButton button = new JToggleButton(e.name());
  button.addActionListener(this);
  add(button);
}

代码示例来源:origin: org.nuiton.jaxx/jaxx-widgets

protected void createShowPopUpButton() {
  $objectMap.put("showPopUpButton", showPopUpButton = new JToggleButton());
  
  showPopUpButton.setName("showPopUpButton");
  showPopUpButton.setFocusPainted(false);
  showPopUpButton.setFocusable(false);
  showPopUpButton.setToolTipText(t("numbereditor.action.show.tip"));
  showPopUpButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__showPopUpButton"));
}

代码示例来源:origin: org.nuiton.jaxx/jaxx-runtime-swing-widget

protected void createButton() {
  button = new javax.swing.JToggleButton();
  $objectMap.put("button", button);
  button.setName("button");
  button.setFocusPainted(false);
  button.setFocusable(false);
  button.setToolTipText(_("numbereditor.action.show.tip"));
  button.addActionListener((java.awt.event.ActionListener) jaxx.runtime.Util.getEventListener(java.awt.event.ActionListener.class, "actionPerformed", $JPanel0, "doActionPerformed__on__button"));
}

相关文章

JToggleButton类方法