public static JButton makeSmallButton(JButton button) { button.setMargin(new Insets(0, 0, 0, 0)); button.putClientProperty("Nimbus.Overrides", smallButtonUIDefaults); return button; }
highlightButton = makeColorButton("Pick a new highlight color: ", Preferences.getHighlightColor(), prefPanel); highlightButton.putClientProperty("JButton.buttonType","icon"); displayOptions.add(highlightLabel); displayOptions.add(highlightButton);
button.setToolTipText(navigationButton.getTooltip()); button.setIcon(new ImageIcon(scaledImage)); button.putClientProperty(SubstanceSynapse.FLAT_LOOK, Boolean.TRUE); button.setFocusable(false); button.addActionListener(e ->
public DataControl(String nodePath, Port port) { super(nodePath, port); setLayout(new BoxLayout(this, BoxLayout.LINE_AXIS)); clearDataButton = new JButton("Clear"); clearDataButton.setMargin(new Insets(1, 0, 0, 0)); clearDataButton.putClientProperty("JButton.buttonType", "textured"); clearDataButton.putClientProperty("JComponent.sizeVariant", "small"); clearDataButton.setFont(Theme.SMALL_BOLD_FONT); clearDataButton.setForeground(Theme.TEXT_NORMAL_COLOR); clearDataButton.addActionListener(this); add(clearDataButton); /*showDataButton = new JButton("Show Data..."); showDataButton.setMargin(new Insets(1, 0, 0, 0)); showDataButton.putClientProperty("JButton.buttonType", "textured"); showDataButton.putClientProperty("JComponent.sizeVariant", "small"); showDataButton.setFont(Theme.SMALL_BOLD_FONT); showDataButton.setForeground(Theme.TEXT_NORMAL_COLOR); showDataButton.addActionListener(this); add(showDataButton);*/ add(Box.createHorizontalGlue()); }
public FileControl(String nodePath, Port port) { super(nodePath, port); setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0)); fileField = new JTextField(); fileField.putClientProperty("JComponent.sizeVariant", "small"); fileField.setPreferredSize(new Dimension(150, 19)); fileField.setEditable(false); fileField.setFont(Theme.SMALL_BOLD_FONT); chooseButton = new JButton("..."); chooseButton.putClientProperty("JButton.buttonType", "gradient"); chooseButton.setPreferredSize(new Dimension(30, 27)); chooseButton.addActionListener(this); add(fileField); add(chooseButton); setValueForControl(port.getValue()); }
public TextControl(String nodePath, Port port) { super(nodePath, port); setLayout(new BorderLayout(0, 0)); textField = new JTextField(); textField.putClientProperty("JComponent.sizeVariant", "small"); textField.setFont(Theme.SMALL_BOLD_FONT); textField.addActionListener(this); externalWindowButton = new JButton("..."); externalWindowButton.putClientProperty("JComponent.sizeVariant", "small"); externalWindowButton.putClientProperty("JButton.buttonType", "gradient"); externalWindowButton.setFont(Theme.SMALL_BOLD_FONT); externalWindowButton.addActionListener(this); add(textField, BorderLayout.CENTER); add(externalWindowButton, BorderLayout.EAST); setValueForControl(port.getValue()); }
filePanel.add(fileField); JButton chooseButton = new JButton("..."); chooseButton.putClientProperty("JButton.buttonType", "gradient"); chooseButton.setPreferredSize(new Dimension(30, 27)); chooseButton.addActionListener(this);
directoryPanel.add(directoryField); JButton chooseButton = new JButton("..."); chooseButton.putClientProperty("JButton.buttonType", "gradient"); chooseButton.setPreferredSize(new Dimension(30, 27)); chooseButton.addActionListener(this);
private void updateButtonPositions() { if (rejectChangesButton.isVisible() && acceptChangesButton.isVisible()) { rejectChangesButton.putClientProperty("JButton.segmentPosition", "first"); acceptChangesButton.putClientProperty("JButton.segmentPosition", "last"); } else { rejectChangesButton.putClientProperty("JButton.segmentPosition", "only"); acceptChangesButton.putClientProperty("JButton.segmentPosition", "only"); } }
public static JButton getTexturedButton(String s) { JButton button = new JButton(s); button.setFocusable(false); button.putClientProperty("JButton.buttonType", "textured"); return button; }
public static JButton getSoftButton(String string) { JButton b = new JButton(string); //b.putClientProperty("JButton.buttonType", "segmentedRoundRect"); //b.putClientProperty("JButton.segmentPosition", "only"); b.setFocusable(false); b.putClientProperty("JComponent.sizeVariant", "small"); return b; }
JButton org = null; for (int i = 0; i < combo.getComponentCount(); i++) { if (combo.getComponent(i) instanceof JButton) { org = (JButton) combo.getComponent(i); UIDefaults buttonDefaults = new UIDefaults(); buttonDefaults.put("ComboBox:\"ComboBox.arrowButton\"[Enabled].foregroundPainter", painter); org.putClientProperty("Nimbus.Overrides.InheritDefaults", false); org.putClientProperty("Nimbus.Overrides", buttonDefaults); break; } }
protected void setActive(boolean flag) { if (getWindowDecorationStyle() == BaseRootPaneUI.FRAME) { Boolean active = flag ? Boolean.TRUE : Boolean.FALSE; iconifyButton.putClientProperty(PAINT_ACTIVE, active); closeButton.putClientProperty(PAINT_ACTIVE, active); maxButton.putClientProperty(PAINT_ACTIVE, active); } getRootPane().repaint(); }
public static JButton getTexturedButton(ImageIcon icon) { JButton button = new JButton(icon); ViewUtil.makeSmall(button); button.setFocusable(false); button.putClientProperty("JButton.buttonType", "textured"); return button; }
private void initButtonPanel() { buttonPanel.setLayout(new GridLayout(0, 1, 20, 20)); mainButtonPanel.setLayout(new BorderLayout()); mainButtonPanel.add(buttonPanel, BorderLayout.NORTH); JButton btExit = new JButton(Labels.getString("main-panel-exit-button")); btExit.addActionListener(e -> settlersFrame.exit()); btExit.putClientProperty(ELFStyle.KEY, ELFStyle.BUTTON_MENU); mainButtonPanel.add(btExit, BorderLayout.SOUTH); add(mainButtonPanel); add(emptyPanel); getTitleLabel().setVisible(false); }
private JButton adjustButton(JButton b) { b.setBorderPainted(false); b.setOpaque(false); b.setText(null); b.putClientProperty("hideActionText", Boolean.TRUE); // NOI18N // NOI18N return b; }
public static JButton createArrowButton(int pointTowards, int size) { Icon arrow = NapkinIconFactory.createArrowIcon(pointTowards, size); JButton button = new JButton(arrow); button.setBorderPainted(false); Dimension dim = new Dimension(size + 3, size + 3); button.setPreferredSize(dim); button.setMinimumSize(dim); button.putClientProperty(NO_ROLLOVER_KEY, Boolean.TRUE); return button; }
/** * Configures the straight side of the arrow button. */ protected void configureArrowButtonStraightSide() { this.arrowButton.putClientProperty( SubstanceLookAndFeel.BUTTON_SIDE_PROPERTY, this.comboBox .getComponentOrientation().isLeftToRight() ? Side.LEFT : Side.RIGHT); }
public void setDisclosureStateCount(int newValue) { int oldValue = getDisclosureStateCount(); disclosureButton.putClientProperty(DisclosureIcon.STATE_COUNT_PROPERTY, newValue); firePropertyChange(DISCLOSURE_STATE_COUNT_PROPERTY, oldValue, newValue); }
private void configurePopupButton() { Side side = this.datePicker.getComponentOrientation().isLeftToRight() ? Side.LEFT : Side.RIGHT; this.substancePopupButton.putClientProperty( SubstanceLookAndFeel.BUTTON_SIDE_PROPERTY, side); // this.substancePopupButton.putClientProperty( // SubstanceLookAndFeel.BUTTON_OPEN_SIDE_PROPERTY, side); // this.substancePopupButton.putClientProperty( // SubstanceLookAndFeel.FLAT_PROPERTY, Boolean.TRUE); this.substancePopupButton.setRolloverEnabled(true); }