muteButton.setHorizontalTextPosition(JToggleButton.CENTER); muteButton.setFocusable(false); muteButton.setPreferredSize(new Dimension(60, 50));
private AbstractButton createSwitchPanelsButton() { final JToggleButton switchPanelsButton = new JToggleButton("Switch panels"); switchPanelsButton.addItemListener(e -> { if (e.getStateChange() == ItemEvent.SELECTED) { createAndShowSwitchPanelsMenu((JComponent) e.getSource(), switchPanelsButton); } }); switchPanelsButton.setFocusable(false); switchPanelsButton.setHorizontalTextPosition(SwingConstants.LEADING); return switchPanelsButton; }
jToggleListView.setToolTipText("Shows the cards as a list."); jToggleListView.setBorder(null); jToggleListView.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING); jToggleListView.setMargin(new java.awt.Insets(2, 6, 2, 6)); jToggleListView.setMaximumSize(new java.awt.Dimension(37, 25)); jToggleCardView.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/card_panel.png"))); // NOI18N jToggleCardView.setToolTipText("Shows the card as images."); jToggleCardView.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING); jToggleCardView.setMargin(new java.awt.Insets(2, 6, 2, 6)); jToggleCardView.setPreferredSize(new java.awt.Dimension(40, 22));
tbRed.setActionCommand("Red"); tbRed.setFocusable(false); tbRed.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); tbRed.setSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/color_red.png"))); // NOI18N tbRed.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); tbGreen.setActionCommand("Green"); tbGreen.setFocusable(false); tbGreen.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); tbGreen.setSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/color_green.png"))); // NOI18N tbGreen.setVerifyInputWhenFocusTarget(false); tbBlue.setActionCommand("Blue"); tbBlue.setFocusable(false); tbBlue.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); tbBlue.setSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/color_blue.png"))); // NOI18N tbBlue.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); tbBlack.setActionCommand("Black"); tbBlack.setFocusable(false); tbBlack.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); tbBlack.setSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/color_black.png"))); // NOI18N tbBlack.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); tbWhite.setActionCommand("White"); tbWhite.setFocusable(false); tbWhite.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); tbWhite.setSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/color_white.png"))); // NOI18N tbWhite.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
btnStateWaiting.setFocusPainted(false); btnStateWaiting.setFocusable(false); btnStateWaiting.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); btnStateWaiting.setRequestFocusEnabled(false); btnStateWaiting.setVerifyInputWhenFocusTarget(false); btnStateActive.setFocusPainted(false); btnStateActive.setFocusable(false); btnStateActive.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); btnStateActive.setRequestFocusEnabled(false); btnStateActive.setVerifyInputWhenFocusTarget(false); btnStateFinished.setFocusPainted(false); btnStateFinished.setFocusable(false); btnStateFinished.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); btnStateFinished.setRequestFocusEnabled(false); btnStateFinished.setVerifyInputWhenFocusTarget(false); btnTypeMatch.setFocusPainted(false); btnTypeMatch.setFocusable(false); btnTypeMatch.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); btnTypeMatch.setRequestFocusEnabled(false); btnTypeMatch.setVerifyInputWhenFocusTarget(false); btnSkillBeginner.setFocusPainted(false); btnSkillBeginner.setFocusable(false); btnSkillBeginner.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); btnSkillBeginner.setRequestFocusEnabled(false); btnSkillBeginner.setVerifyInputWhenFocusTarget(false);
/** * Return the pauseButton * * @return JToggleButton */ private JToggleButton getPauseButton() { if (pauseButton == null) { pauseButton = new JToggleButton("Pause/Debug"); pauseButton.setMnemonic('P'); pauseButton.setHorizontalTextPosition(SwingConstants.CENTER); pauseButton.setVerticalTextPosition(SwingConstants.BOTTOM); pauseButton.addActionListener(eventHandler); } return pauseButton; }
memStatusBtn.setHorizontalTextPosition(SwingConstants.LEFT);
private static JToggleButton createToggleButton(String toolTipText, ImageIcon icon, java.awt.event.ActionListener actionListener) { JToggleButton btn = new JToggleButton(); btn.setMargin(new Insets(0, 0, 0, 0)); btn.setPreferredSize(new Dimension(30, 30)); btn.setIcon(icon); btn.setMinimumSize(new Dimension(30, 30)); btn.setVerticalTextPosition(SwingConstants.BOTTOM); btn.setSelected(false); btn.setToolTipText(toolTipText); btn.setHorizontalTextPosition(SwingConstants.CENTER); btn.setFont(new java.awt.Font("SansSerif", 0, 10)); btn.setMaximumSize(new Dimension(30, 30)); btn.addActionListener(actionListener); return btn; }
private void addButton(String title, ImageIcon icon, final Component component) { Action action = new AbstractAction(title, icon) { private static final long serialVersionUID = -5307503386163952433L; @Override public void actionPerformed(ActionEvent e) { show(component); } }; JToggleButton button = new JToggleButton(action); button.setHorizontalTextPosition(JButton.CENTER); button.setVerticalTextPosition(JButton.BOTTOM); button.setUI(new ButtonBarButtonUI()); buttonBar.add(button); buttonGroup.add(button); if (buttonGroup.getSelection() == null) { button.setSelected(true); show(component); } }
org.openide.awt.Mnemonics.setLocalizedText(grayedButton, org.openide.util.NbBundle.getMessage(ProjectContextTopComponent.class, "ProjectContextTopComponent.grayedButton.text")); // NOI18N grayedButton.setFocusable(false); grayedButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); grayedButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); grayedButton.addActionListener(new java.awt.event.ActionListener() { org.openide.awt.Mnemonics.setLocalizedText(excludeButton, org.openide.util.NbBundle.getMessage(ProjectContextTopComponent.class, "ProjectContextTopComponent.excludeButton.text")); // NOI18N excludeButton.setFocusable(false); excludeButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); excludeButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); excludeButton.addActionListener(new java.awt.event.ActionListener() {
org.openide.awt.Mnemonics.setLocalizedText(grayedButton, org.openide.util.NbBundle.getMessage(FilesContextTopComponent.class, "FilesContextTopComponent.grayedButton.text")); // NOI18N grayedButton.setFocusable(false); grayedButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); grayedButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); grayedButton.addActionListener(new java.awt.event.ActionListener() { org.openide.awt.Mnemonics.setLocalizedText(excludeButton, org.openide.util.NbBundle.getMessage(FilesContextTopComponent.class, "FilesContextTopComponent.excludeButton.text")); // NOI18N excludeButton.setFocusable(false); excludeButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); excludeButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); excludeButton.addActionListener(new java.awt.event.ActionListener() {
memStatusBtn.setHorizontalTextPosition(SwingConstants.LEFT);
tb.setToolTipText(displayName); Methods.invokeIfExists(tb, "setFocusable", false); tb.setHorizontalTextPosition(SwingConstants.CENTER); tb.setVerticalTextPosition(SwingConstants.BOTTOM); tb.setFont(UIManager.getFont("ColorChooser.font"));
JToggleButton button = new JToggleButton(text, icon); button.setVerticalTextPosition(AbstractButton.BOTTOM); button.setHorizontalTextPosition(AbstractButton.CENTER); button.setContentAreaFilled(false); try {
tb.setToolTipText(displayName); Methods.invokeIfExists(tb, "setFocusable", false); tb.setHorizontalTextPosition(SwingConstants.CENTER); tb.setVerticalTextPosition(SwingConstants.BOTTOM); tb.setFont(UIManager.getFont("ColorChooser.font"));
JToggleButton button = new JToggleButton(text, icon); button.setVerticalTextPosition(AbstractButton.BOTTOM); button.setHorizontalTextPosition(AbstractButton.CENTER); button.setContentAreaFilled(false); try {
shortCutPanelMyProjectButton.setForeground(fileChooser.getForeground()); shortCutPanelMyProjectButton.setHorizontalTextPosition(JToggleButton.CENTER); shortCutPanelMyProjectButton.setVerticalTextPosition(JToggleButton.BOTTOM); shortCutPanelMyProjectButton.setAlignmentX(JComponent.CENTER_ALIGNMENT);
shortCutPanelMyProjectButton.setForeground(fileChooser.getForeground()); shortCutPanelMyProjectButton.setHorizontalTextPosition(JToggleButton.CENTER); shortCutPanelMyProjectButton.setVerticalTextPosition(JToggleButton.BOTTOM); shortCutPanelMyProjectButton.setAlignmentX(JComponent.CENTER_ALIGNMENT);
calls.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); calls.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); calls.addActionListener(new java.awt.event.ActionListener() { callers.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); callers.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); callers.addActionListener(new java.awt.event.ActionListener() {
graphToggle.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); graphToggle.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); graphToggle.addItemListener(new java.awt.event.ItemListener() {