JButton button1 = new JButton("OK"); button1.setEnabled(false); button1.setAlignmentX(-1); JButton button2 = new JButton("Apply"); button1.setEnabled(false); button1.setAlignmentX(-1);
JButton button_ok = makeButton("OK", false, -1); JButton button_apply = makeButton("Apply", true, 1); // what exactly is being set here? ... // much later: private static JButton makeButton(String name, boolean enabled, int alignment) { JButton button = new JButton(name); button.setEnabled(enabled); button.setAlignmentX(alignment); return button; }
close.setAlignmentX(0.5f);
close.setAlignmentX(0.5f);
newButton.setAlignmentX(0.5f);
zoomPanel.add(Box.createVerticalGlue()); JButton zoomIn = new JButton("Zoom In"); zoomIn.setAlignmentX(CENTER_ALIGNMENT); zoomIn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { zoomPanel.add(zoomIn); JButton zoomOut = new JButton("Zoom Out"); zoomOut.setAlignmentX(CENTER_ALIGNMENT); zoomOut.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) {
zoomPanel.add(Box.createVerticalGlue()); JButton zoomIn = new JButton("Zoom In"); zoomIn.setAlignmentX(CENTER_ALIGNMENT); zoomIn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { zoomPanel.add(zoomIn); JButton zoomOut = new JButton("Zoom Out"); zoomOut.setAlignmentX(CENTER_ALIGNMENT); zoomOut.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) {
searchButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/search_24.png"))); searchButton.setToolTipText("Search and select from list"); searchButton.setAlignmentX(1.0F); searchButton.setMinimumSize(new java.awt.Dimension(24, 24)); searchButton.setPreferredSize(new java.awt.Dimension(32, 32));
pauseButton.setAlignmentX(CENTER_ALIGNMENT); stepButton.setAlignmentX(CENTER_ALIGNMENT); resetButton.setAlignmentX(CENTER_ALIGNMENT); saveButton.setAlignmentX(CENTER_ALIGNMENT); loadButton.setAlignmentX(CENTER_ALIGNMENT); quitButton.setAlignmentX(CENTER_ALIGNMENT);
pnlRandomPacks.add(txtRandomPacks); JButton btnSelectRandomPacks = new JButton(); btnSelectRandomPacks.setAlignmentX(Component.LEFT_ALIGNMENT); btnSelectRandomPacks.setText("Select packs to be included in the pool"); btnSelectRandomPacks.setToolTipText(RandomPacksSelectorDialog.randomDraftDescription);
buttonStop.setAlignmentX(0.5F); buttonStop.setPreferredSize(new java.awt.Dimension(65, 30)); buttonStop.addActionListener(new java.awt.event.ActionListener() { buttonSearchSet.setAlignmentX(1.0F); buttonSearchSet.setPreferredSize(new java.awt.Dimension(25, 25)); buttonSearchSet.addActionListener(new java.awt.event.ActionListener() {
btnSetFastSearch.setAlignmentX(1.0F); btnSetFastSearch.setPreferredSize(new java.awt.Dimension(23, 23)); btnSetFastSearch.addActionListener(new java.awt.event.ActionListener() {
btn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/search_32.png"))); btn.setToolTipText(FastSearchUtil.DEFAULT_EXPANSION_TOOLTIP_MESSAGE); btn.setAlignmentX(1.0F); btn.setPreferredSize(new java.awt.Dimension(32, 32)); btn.addActionListener(new java.awt.event.ActionListener() {
btnFlagSearch.setAlignmentX(1.0F); btnFlagSearch.setPreferredSize(new java.awt.Dimension(23, 23)); btnFlagSearch.addActionListener(new java.awt.event.ActionListener() {
buttonsPanel.setLayout(boxlayout); btnExit = new javax.swing.JButton(); btnExit.setAlignmentX(Component.LEFT_ALIGNMENT); buttonsPanel.add(btnExit); btnSetFastSearch.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/search_24.png"))); btnSetFastSearch.setToolTipText(FastSearchUtil.DEFAULT_EXPANSION_TOOLTIP_MESSAGE); btnSetFastSearch.setAlignmentX(1.0F); btnSetFastSearch.setMinimumSize(new java.awt.Dimension(24, 24)); btnSetFastSearch.setPreferredSize(new java.awt.Dimension(32, 32));
btnExpansionSearch.setAlignmentX(1.0F); btnExpansionSearch.setFocusable(false); btnExpansionSearch.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
JPanel panel = new JPanel(); panel.setLayout(new BoxLayout()); JButton button = new JButton("Button1"); button.setAlignmentX(Component.CENTER_ALIGNMENT); panel.add(button); button = new JButton("Button2"); button.setAlignmentX(Component.CENTER_ALIGNMENT); panel.add(button); button = new JButton("Button3"); button.setAlignmentX(Component.CENTER_ALIGNMENT); panel.add(button); add(panel);
private JButton createSelectNodesButton() { JButton btnHighlightSlideContent = createButtonWithIcon("SelectSlideContent.icon", "slide.select.tooltip"); btnHighlightSlideContent.setAlignmentX(Component.CENTER_ALIGNMENT); btnHighlightSlideContent.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { slide.replaceCurrentSelection(); } }); return btnHighlightSlideContent; } private JToggleButton createSetFoldingStateToggleButton() {
private JButton createSetSelectedNodeButton() { JButton btnSetSelectedNode = createButtonWithIcon("SetSlideContent.icon", "slide.set.tooltip"); btnSetSelectedNode.setAlignmentX(Component.CENTER_ALIGNMENT); btnSetSelectedNode.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { final List<String> selection = Controller.getCurrentController().getSelection().getOrderedSelectionIds(); UndoableSlide.of(slide).setSelectedNodeIds(new LinkedHashSet<>(selection)); } }); return btnSetSelectedNode; }
private void addUri(Box box, String uriProperty, String message) { try { URI uri; uri = new URI( ResourceController.getResourceController().getProperty(uriProperty)); JButton uriButton = UITools.createHtmlLinkStyleButton(uri, message); uriButton.setAlignmentX(Component.LEFT_ALIGNMENT); uriButton.setHorizontalAlignment(SwingConstants.LEADING); box.add(uriButton); } catch (URISyntaxException e1) { } } }