本文整理了Java中javax.swing.JButton.setVerticalAlignment()
方法的一些代码示例,展示了JButton.setVerticalAlignment()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JButton.setVerticalAlignment()
方法的具体详情如下:
包路径:javax.swing.JButton
类名称:JButton
方法名:setVerticalAlignment
暂无
代码示例来源:origin: magefree/mage
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) {
代码示例来源:origin: stackoverflow.com
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);
代码示例来源:origin: antlr/antlrworks
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;
}
代码示例来源:origin: syedlopez/proguard
/**
* 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;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mylyn-util
btnEditPreview.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
btnEditPreview.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
代码示例来源:origin: digital-preservation/droid
cancelButton.setVerticalAlignment(SwingConstants.BOTTOM);
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
代码示例来源:origin: uk.gov.nationalarchives/droid-ui
cancelButton.setVerticalAlignment(SwingConstants.BOTTOM);
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
代码示例来源:origin: omegat-org/omegat
resetCurrentColorButton.setVerticalAlignment(javax.swing.SwingConstants.TOP);
jPanel4.add(resetCurrentColorButton);
代码示例来源:origin: jtrfp/terminal-recall
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);
代码示例来源:origin: digital-preservation/droid
cancelButton.setVerticalAlignment(SwingConstants.BOTTOM);
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
代码示例来源:origin: uk.gov.nationalarchives/droid-ui
cancelButton.setVerticalAlignment(SwingConstants.BOTTOM);
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
代码示例来源:origin: Exslims/MercuryTrade
button.setVerticalAlignment(SwingConstants.CENTER);
BufferedImage icon = null;
try {
代码示例来源:origin: pvto/konte-art
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() {
代码示例来源:origin: igvteam/igv
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() {
代码示例来源:origin: nu.zoom/svansprogram
tailControl.setVerticalAlignment(SwingConstants.BOTTOM);
代码示例来源:origin: antlr/antlrworks
iconButton.setOpaque(false);
iconButton.setVerifyInputWhenFocusTarget(false);
iconButton.setVerticalAlignment(SwingConstants.TOP);
contentPane.add(iconButton, cc.xywh(1, 1, 1, 37));
代码示例来源:origin: org.activecomponents.jadex/jadex-runtimetools-swing
button.setMinimumSize(BUTTON_DIM);
button.setHorizontalAlignment(SwingConstants.CENTER);
button.setVerticalAlignment(SwingConstants.CENTER);
button.setToolTipText(pl.getName());
button.getModel().addItemListener(new ItemListener()
代码示例来源:origin: net.sourceforge.jadex/jadex-runtimetools-swing
button.setMinimumSize(BUTTON_DIM);
button.setHorizontalAlignment(SwingConstants.CENTER);
button.setVerticalAlignment(SwingConstants.CENTER);
button.setToolTipText(pl.getName());
button.getModel().addItemListener(new ItemListener()
内容来源于网络,如有侵权,请联系作者删除!