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

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

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

JButton.setName介绍

暂无

代码示例

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

  1. btnPlayerName.setName("btnPlayerName"); // NOI18N
  2. btnPlayerName.addActionListener(evt -> btnPlayerNameActionPerformed(evt));
  3. lblGrave.setName("lblGrave"); // NOI18N
  4. btnGrave.setName("btnGrave"); // NOI18N
  5. btnGrave.addActionListener(evt -> btnGraveActionPerformed(evt));

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

  1. jButton1.setName("findServerBtn"); // NOI18N
  2. jButton1.addActionListener(evt -> findPublicServerActionPerformed(evt));

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

  1. btnImport.setName("btnImport"); // NOI18N
  2. btnImport.addActionListener(evt -> {
  3. Object[] options = {"File", "Clipboard", "Append from Clipboard"};
  4. btnSubmit.setName("btnSubmit"); // NOI18N
  5. btnSubmit.addActionListener(evt -> btnSubmitActionPerformed(evt));
  6. btnSubmitTimer.setName("btnSubmitTimer");
  7. btnSubmitTimer.addActionListener(evt -> btnSubmitTimerActionPerformed(evt));
  8. btnAddLand.setName("btnAddLand"); // NOI18N
  9. btnAddLand.addActionListener(evt -> btnAddLandActionPerformed(evt));
  10. btnGenDeck.setName("btnGenDeck");
  11. btnGenDeck.addActionListener(evt -> btnGenDeckActionPerformed(evt));
  12. txtTimeRemaining.setEditable(false);

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

  1. btnFindMain.setMaximumSize(new java.awt.Dimension(42, 23));
  2. btnFindMain.setMinimumSize(new java.awt.Dimension(42, 23));
  3. btnFindMain.setName("connectXmageDeBtn"); // NOI18N
  4. btnFindMain.setPreferredSize(new java.awt.Dimension(23, 23));
  5. btnFindMain.addActionListener(new java.awt.event.ActionListener() {
  6. btnFindLocal.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
  7. btnFindLocal.setMargin(new java.awt.Insets(2, 2, 2, 2));
  8. btnFindLocal.setName("connectLocalhostBtn"); // NOI18N
  9. btnFindLocal.setPreferredSize(new java.awt.Dimension(23, 23));
  10. btnFindLocal.addActionListener(new java.awt.event.ActionListener() {
  11. btnFindUs.setAlignmentY(0.0F);
  12. btnFindUs.setMargin(new java.awt.Insets(2, 2, 2, 2));
  13. btnFindUs.setName("connectXmageusBtn"); // NOI18N
  14. btnFindUs.setPreferredSize(new java.awt.Dimension(23, 23));
  15. btnFindUs.addActionListener(new java.awt.event.ActionListener() {
  16. btnFindOther.setToolTipText("Choose server from full servers list");
  17. btnFindOther.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
  18. btnFindOther.setName("findServerBtn"); // NOI18N
  19. btnFindOther.addActionListener(new java.awt.event.ActionListener() {
  20. public void actionPerformed(java.awt.event.ActionEvent evt) {

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

  1. btn.setName(TOOLBAR_POINTER_BUTTON_NAME);
  2. toolBar.add(btn);
  3. cursorToolGrp.add(btn);
  4. btn.setName(TOOLBAR_ZOOMIN_BUTTON_NAME);
  5. toolBar.add(btn);
  6. cursorToolGrp.add(btn);
  7. btn.setName(TOOLBAR_ZOOMOUT_BUTTON_NAME);
  8. toolBar.add(btn);
  9. cursorToolGrp.add(btn);
  10. btn.setName(TOOLBAR_PAN_BUTTON_NAME);
  11. toolBar.add(btn);
  12. cursorToolGrp.add(btn);
  13. btn.setName(TOOLBAR_INFO_BUTTON_NAME);
  14. toolBar.add(btn);
  15. btn.setName(TOOLBAR_RESET_BUTTON_NAME);
  16. toolBar.add(btn);

代码示例来源:origin: dboissier/mongo4idea

  1. defaultRowLimitTextField.setDocument(new NumberDocument());
  2. testConnectionButton.setName("testConnection");

代码示例来源:origin: otros-systems/otroslogviewer

  1. public void setApproveAction(Action action) {
  2. actionApproveDelegate = action;
  3. actionApproveButton.setAction(actionApproveDelegate);
  4. actionApproveButton.setName("VfsBrowser.open");
  5. actionApproveButton.setText(String.format("%s [Ctrl+Enter]", actionApproveDelegate.getValue(Action.NAME)));
  6. if (targetFileSelected) {
  7. actionApproveDelegate.actionPerformed(
  8. // TODO: Does actionResult provide an ID for 2nd param here,
  9. // or should use a Random number?
  10. new ActionEvent(action, (int) new Date().getTime(), "SELECTED_FILE"));
  11. }
  12. }

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

  1. private JButton createButton(final String name) {
  2. final JButton button = new JButton(getText(name));
  3. button.setName(name);
  4. return button;
  5. }

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

  1. protected void createAdd() {
  2. $objectMap.put("add", add = new JButton());
  3. add.setName("add");
  4. add.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__add"));
  5. }

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

  1. protected void createAdd() {
  2. $objectMap.put("add", add = new JButton());
  3. add.setName("add");
  4. add.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__add"));
  5. }

代码示例来源:origin: jsettlers/settlers-remake

  1. @Override
  2. protected JButton createArrowButton() {
  3. JButton button = new ScrollbarUiButton(BasicArrowButton.SOUTH, UIDefaults.ARROW_COLOR);
  4. button.setName("ComboBox.arrowButton");
  5. return button;
  6. }
  7. }

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

  1. protected void createResetButton() {
  2. $objectMap.put("resetButton", resetButton = new JButton());
  3. resetButton.setName("resetButton");
  4. resetButton.setFocusable(false);
  5. resetButton.setFocusPainted(false);
  6. resetButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__resetButton"));
  7. }

代码示例来源:origin: org.nuiton.jrst/jrst

  1. protected void createBoutonConvertir() {
  2. $objectMap.put("boutonConvertir", boutonConvertir = new JButton());
  3. boutonConvertir.setName("boutonConvertir");
  4. boutonConvertir.setText(t("Convert"));
  5. boutonConvertir.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__boutonConvertir"));
  6. }

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

  1. private void initializeMoveColorUpButton() {
  2. moveColorUp.setName("moveColorUp");
  3. moveColorUp.setFont(BUTTON_FONT);
  4. moveColorUp.setText(MOVE_UP);
  5. moveColorUp.addActionListener(new ColorSwapper(-1));
  6. moveColorUp.setVisible(index > 0);
  7. }

代码示例来源:origin: org.nuiton.jrst/jrst

  1. protected void createAddXslButton() {
  2. $objectMap.put("addXslButton", addXslButton = new JButton(Resource.getIcon("icone/more.gif")));
  3. addXslButton.setName("addXslButton");
  4. addXslButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__addXslButton"));
  5. }

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

  1. private void initializeAddButton() {
  2. addNextColor.setName("addNextColor");
  3. addNextColor.setFont(BUTTON_FONT);
  4. addNextColor.setText(ADD);
  5. addNextColor.addActionListener(new ColorAdder(index + 1));
  6. }

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

  1. protected void createResetSelection() {
  2. $objectMap.put("resetSelection", resetSelection = new JButton());
  3. resetSelection.setName("resetSelection");
  4. resetSelection.setFocusable(false);
  5. resetSelection.setToolTipText(t("beanlist.action.reset.tip"));
  6. resetSelection.setFocusPainted(false);
  7. resetSelection.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__resetSelection"));
  8. }

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

  1. protected void createDefaultSize() {
  2. $objectMap.put("defaultSize", defaultSize = new JButton());
  3. defaultSize.setName("defaultSize");
  4. defaultSize.setFocusPainted(false);
  5. defaultSize.setFocusable(false);
  6. defaultSize.setToolTipText(t("fontsize.action.default.tip"));
  7. defaultSize.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__defaultSize"));
  8. }

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

  1. private void initializeMoveColorDownButton() {
  2. moveColorDown.setName("moveColorDown");
  3. moveColorDown.setFont(BUTTON_FONT);
  4. moveColorDown.setText(MOVE_DOWN);
  5. moveColorDown.addActionListener(new ColorSwapper(+1));
  6. updateMoveColorDownButton();
  7. }

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

  1. private void addAddColorButton() {
  2. formlayout.appendRow(RowSpec.decode("CENTER:DEFAULT:NONE"));
  3. JButton addColor = new JButton();
  4. addColor.addActionListener(new ColorAdder(0));
  5. addColor.setName("addColor");
  6. addColor.setFont(BUTTON_FONT);
  7. addColor.setText(ADD);
  8. panel.add(addColor, cc.xy(11, 1));
  9. }

相关文章

JButton类方法