javax.swing.JLabel.setVerticalTextPosition()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(230)

本文整理了Java中javax.swing.JLabel.setVerticalTextPosition()方法的一些代码示例,展示了JLabel.setVerticalTextPosition()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JLabel.setVerticalTextPosition()方法的具体详情如下:
包路径:javax.swing.JLabel
类名称:JLabel
方法名:setVerticalTextPosition

JLabel.setVerticalTextPosition介绍

暂无

代码示例

代码示例来源:origin: redwarp/9-Patch-Resizer

public AboutDialog(JFrame parent) {
  this.setResizable(false);
  this.setSize(new Dimension(400, 250));
  this.getContentPane().setLayout(new BorderLayout(0, 0));
  JLabel lblResizer = new JLabel(Localization.get("app_name") + " "
      + Configuration.getVersion());
  lblResizer.setBorder(new EmptyBorder(10, 10, 10, 10));
  lblResizer.setVerticalTextPosition(SwingConstants.BOTTOM);
  lblResizer.setIconTextGap(10);
  lblResizer.setFont(lblResizer.getFont().deriveFont(
      lblResizer.getFont().getStyle() | Font.BOLD, 16f));
  lblResizer.setIcon(new ImageIcon(AboutDialog.class
      .getResource("/img/icon_64.png")));
  this.getContentPane().add(lblResizer, BorderLayout.NORTH);
  JTextArea txtrResizerIsA = new JTextArea();
  txtrResizerIsA.setEditable(false);
  txtrResizerIsA.setWrapStyleWord(true);
  txtrResizerIsA.setBorder(new EmptyBorder(0, 10, 10, 10));
  txtrResizerIsA.setFont(UIManager.getFont("Label.font"));
  txtrResizerIsA.setLineWrap(true);
  txtrResizerIsA.setText(Localization.get("about_text"));
  txtrResizerIsA.setBackground(new Color(0, 0, 0, 0));
  this.getContentPane().add(txtrResizerIsA, BorderLayout.CENTER);
  this.setLocationRelativeTo(parent);
}

代码示例来源:origin: stackoverflow.com

super(new BorderLayout());
this.model = model;
label.setVerticalTextPosition(JLabel.BOTTOM);
label.setHorizontalTextPosition(JLabel.CENTER);
this.add(label, BorderLayout.CENTER);

代码示例来源:origin: nodebox/nodebox

alert.setPreferredSize(new Dimension(Short.MAX_VALUE, 80));
alert.setMaximumSize(new Dimension(Short.MAX_VALUE, 80));
alert.setVerticalTextPosition(SwingConstants.TOP);
controlsPanel.add(alert);
controlsPanel.add(Box.createVerticalStrut(5));

代码示例来源:origin: nodebox/nodebox

alert.setPreferredSize(new Dimension(Short.MAX_VALUE, 80));
alert.setMaximumSize(new Dimension(Short.MAX_VALUE, 80));
alert.setVerticalTextPosition(SwingConstants.TOP);
controlsPanel.add(alert);
controlsPanel.add(Box.createVerticalStrut(5));

代码示例来源:origin: stackoverflow.com

this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
label.setHorizontalTextPosition(JLabel.CENTER);
label.setVerticalTextPosition(JLabel.BOTTOM);
this.add(label);
this.pack();

代码示例来源:origin: magefree/mage

lblURLServerList.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);
lblURLServerList.setPreferredSize(new java.awt.Dimension(110, 16));
lblURLServerList.setVerticalTextPosition(javax.swing.SwingConstants.TOP);

代码示例来源:origin: stackoverflow.com

JLabel label = new JLabel ("hello world", new ImageIcon("file"), JLabel.CENTER);
label.setVerticalTextPosition(SwingConstants.TOP);
frame.add(label);
//frame.add(new JLabel(new ImageIcon("file")));;

代码示例来源:origin: stackoverflow.com

JLabel label = new JLabel("Bring it on");
label.setIcon(new ImageIcon("logo.png"));
label.setHorizontalAlignment(JLabel.CENTER);
label.setVerticalTextPosition(JLabel.BOTTOM);
label.setHorizontalTextPosition(JLabel.CENTER);
JOptionPane.showMessageDialog(null, label, "About", JOptionPane.PLAIN_MESSAGE);

代码示例来源:origin: stackoverflow.com

JLabel label = new JLabel( "Center Text" );
label.setIcon( new ImageIcon( "..." ) );
label.setHorizontalTextPosition( JLabel.CENTER );
label.setVerticalTextPosition( JLabel.CENTER );
frame.add( label );

代码示例来源:origin: stackoverflow.com

JLabel label = new JLabel("your text");
label.setIcon( polygonIcon );
label.setHorizontalTextPosition(JLabel.CENTER);
label.setVerticalTextPosition(JLabel.CENTER);

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction
@Override
public void setVerticalTextPosition(int aValue) {
  super.setVerticalTextPosition(aValue);
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public void setVerticalTextPosition(int _htp)
{
 if((delegate_==this)||(delegate_==null))
  super.setVerticalTextPosition(_htp);
 else
  delegate_.setVerticalTextPosition(_htp);
}

代码示例来源:origin: stackoverflow.com

JLabel label = new JLabel();
label.setIcon(UIManager.getIcon("OptionPane.errorIcon"));
label.setText("My Text");
label.setHorizontalTextPosition(JLabel.CENTER);
label.setVerticalTextPosition(JLabel.CENTER);

代码示例来源:origin: stackoverflow.com

JLabel picture = new JLabel( new ImageIcon(...) );
picture.setText("<html><center>Text<br>over<br>Image<center></html>");
picture.setHorizontalTextPosition(JLabel.CENTER);
picture.setVerticalTextPosition(JLabel.CENTER);

代码示例来源:origin: stackoverflow.com

JLabel label = new JLabel(new ImageIcon(new URL(DECK_URL)));
label.setText("DECK");
label.setHorizontalTextPosition(JLabel.CENTER);
label.setVerticalTextPosition(JLabel.BOTTOM);

代码示例来源:origin: stackoverflow.com

JLabel label1 = new JLabel( new ImageIcon(...) );
label1.setText( "Centered Text" );
label1.setHorizontalTextPosition(JLabel.CENTER);
label1.setVerticalTextPosition(JLabel.CENTER);

代码示例来源:origin: stackoverflow.com

JLabel label = new JLabel( new ShapeIcon(...) );
label.setText( "Centered Text" );
label.setHorizontalTextPosition(JLabel.CENTER);
label.setVerticalTextPosition(JLabel.CENTER);

代码示例来源:origin: igniterealtime/Spark

public ChatStatePanel(ChatState state, CharSequence nickname) {
    setLayout(new FlowLayout(FlowLayout.LEFT, 1, 1));
    JLabel label = new JLabel( Res.getString( state.name(), nickname.toString() ) );
    label.setFont(new Font("Courier New", Font.PLAIN, 9));
    label.setForeground(Color.gray);
    label.setHorizontalTextPosition(JLabel.LEFT);
    label.setVerticalTextPosition(JLabel.BOTTOM);
    add( label );
  }
}

代码示例来源:origin: net.anwiba.commons/anwiba-commons-swing-core

public GridBagLayoutComponentBuilder label(final String text) {
 newline();
 final JLabel label = new JLabel(text + (text.isEmpty() ? "" : ":")); //$NON-NLS-1$ //$NON-NLS-2$
 label.setVerticalTextPosition(JLabel.TOP);
 label.setVerticalAlignment(JLabel.TOP);
 label.setHorizontalTextPosition(JLabel.LEFT);
 label.setHorizontalAlignment(JLabel.LEFT);
 this.components.add(new GridBagLayoutComponent(label, ++this.column, this.row, 1, 1, UNDEFIND_ANCHOR));
 return this;
}

代码示例来源:origin: AndreasFagschlunger/O2Xfs

private void initComponents(final Icon icon) {
  Border border = new LineBorder(getForeground(), 5);
  border = BorderFactory.createCompoundBorder(border, BorderFactory.createEmptyBorder(5, 5, 5, 5));
  setBorder(border);
  label = new JLabel(icon, SwingConstants.LEFT);
  label.setVerticalTextPosition(SwingConstants.TOP);
  label.setVerticalAlignment(SwingConstants.TOP);
  label.setForeground(getForeground());
  add(label, BorderLayout.CENTER);
}

相关文章

JLabel类方法