saveButton.setMinimumSize(new java.awt.Dimension(100, 30)); saveButton.setPreferredSize(new java.awt.Dimension(100, 30)); saveButton.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM); saveButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { exitButton.setMinimumSize(new java.awt.Dimension(100, 30)); exitButton.setPreferredSize(new java.awt.Dimension(100, 30)); exitButton.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM); exitButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) {
JButton JButton = new JButton() { @Override protected void paintComponent(Graphics g) { super.paintComponent(g); int nGap = 10; int nXPosition = nGap; int nYPosition = nGap; int nWidth = getWidth() - nGap * 2; int nHeight = getHeight() - nGap * 2; g.setColor(Color.RED); g.drawOval(nXPosition, nYPosition, nWidth, nHeight); g.fillOval(nXPosition, nYPosition, nWidth, nHeight); } }; JButton.setHorizontalAlignment(JLabel.CENTER); JButton.setVerticalAlignment(JLabel.CENTER);
public JButton createDetachButton() { JButton detach = new JButton(IconManager.shared().getIconDetach()); detach.setBorder(null); detach.setBorderPainted(false); detach.setOpaque(false); detach.setFocusable(false); detach.setVerticalAlignment(JButton.CENTER); detach.setMargin(new Insets(0, 0, 0, 0)); detach.addActionListener(al = new ActionListener() { public void actionPerformed(ActionEvent e) { if(detached) attach(); else detach(); } }); return detach; }
/** * Adds an image below the tab buttons, after all tabs have been added. * The image will only be as visible as permitted by the available space. * * @param image the image. * @return the component containing the image. */ public Component addImage(final Image image) { GridBagConstraints imageConstraints = new GridBagConstraints(); imageConstraints.gridx = 0; imageConstraints.weighty = 1.0; imageConstraints.fill = GridBagConstraints.BOTH; imageConstraints.anchor = GridBagConstraints.SOUTHWEST; JButton component = new JButton(new ImageIcon(image)); component.setFocusPainted(false); component.setFocusable(false); component.setRequestFocusEnabled(false); component.setRolloverEnabled(false); component.setMargin(new Insets(0, 0, 0, 0)); component.setHorizontalAlignment(JButton.LEFT); component.setVerticalAlignment(JButton.BOTTOM); component.setPreferredSize(new Dimension(0, 0)); add(component, imageConstraints); return component; }
btnEditPreview.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM); btnEditPreview.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) {
cancelButton.setVerticalAlignment(SwingConstants.BOTTOM); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) {
cancelButton.setVerticalAlignment(SwingConstants.BOTTOM); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) {
resetCurrentColorButton.setVerticalAlignment(javax.swing.SwingConstants.TOP); jPanel4.add(resetCurrentColorButton);
okButton.setVerticalAlignment(SwingConstants.BOTTOM); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { cancelButton.setHorizontalAlignment(SwingConstants.RIGHT); bottomPanel.add(cancelButton, BorderLayout.EAST); cancelButton.setVerticalAlignment(SwingConstants.BOTTOM); bottomPanel.add(okButton, BorderLayout.WEST);
cancelButton.setVerticalAlignment(SwingConstants.BOTTOM); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) {
cancelButton.setVerticalAlignment(SwingConstants.BOTTOM); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) {
button.setVerticalAlignment(SwingConstants.CENTER); BufferedImage icon = null; try {
jButton6.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButton6.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/konte/resources/ui/24/hl/document.png"))); // NOI18N jButton6.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM); jButton6.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButton6.addActionListener(new java.awt.event.ActionListener() { jButton4.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButton4.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/konte/resources/ui/24/hl/floppy.png"))); // NOI18N jButton4.setVerticalAlignment(javax.swing.SwingConstants.TOP); jButton4.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButton4.addActionListener(new java.awt.event.ActionListener() { jButton5.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButton5.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/konte/resources/ui/24/hl/png.png"))); // NOI18N jButton5.setVerticalAlignment(javax.swing.SwingConstants.TOP); jButton5.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButton5.addActionListener(new java.awt.event.ActionListener() { jButton2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButton2.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/konte/resources/ui/24/hl/Stop.png"))); // NOI18N jButton2.setVerticalAlignment(javax.swing.SwingConstants.TOP); jButton2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButton2.addActionListener(new java.awt.event.ActionListener() {
infoLinkButton.setPreferredSize(new java.awt.Dimension(15, 15)); infoLinkButton.setSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/images/info.gif"))); // NOI18N infoLinkButton.setVerticalAlignment(javax.swing.SwingConstants.TOP); infoLinkButton.setVerticalTextPosition(javax.swing.SwingConstants.TOP); infoLinkButton.addActionListener(new java.awt.event.ActionListener() {
tailControl.setVerticalAlignment(SwingConstants.BOTTOM);
iconButton.setOpaque(false); iconButton.setVerifyInputWhenFocusTarget(false); iconButton.setVerticalAlignment(SwingConstants.TOP); contentPane.add(iconButton, cc.xywh(1, 1, 1, 37));
button.setMinimumSize(BUTTON_DIM); button.setHorizontalAlignment(SwingConstants.CENTER); button.setVerticalAlignment(SwingConstants.CENTER); button.setToolTipText(pl.getName()); button.getModel().addItemListener(new ItemListener()
button.setMinimumSize(BUTTON_DIM); button.setHorizontalAlignment(SwingConstants.CENTER); button.setVerticalAlignment(SwingConstants.CENTER); button.setToolTipText(pl.getName()); button.getModel().addItemListener(new ItemListener()