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); }
super(new BorderLayout()); this.model = model; label.setVerticalTextPosition(JLabel.BOTTOM); label.setHorizontalTextPosition(JLabel.CENTER); this.add(label, BorderLayout.CENTER);
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));
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));
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); label.setHorizontalTextPosition(JLabel.CENTER); label.setVerticalTextPosition(JLabel.BOTTOM); this.add(label); this.pack();
lblURLServerList.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING); lblURLServerList.setPreferredSize(new java.awt.Dimension(110, 16)); lblURLServerList.setVerticalTextPosition(javax.swing.SwingConstants.TOP);
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")));;
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);
JLabel label = new JLabel( "Center Text" ); label.setIcon( new ImageIcon( "..." ) ); label.setHorizontalTextPosition( JLabel.CENTER ); label.setVerticalTextPosition( JLabel.CENTER ); frame.add( label );
JLabel label = new JLabel("your text"); label.setIcon( polygonIcon ); label.setHorizontalTextPosition(JLabel.CENTER); label.setVerticalTextPosition(JLabel.CENTER);
@ScriptFunction @Override public void setVerticalTextPosition(int aValue) { super.setVerticalTextPosition(aValue); }
public void setVerticalTextPosition(int _htp) { if((delegate_==this)||(delegate_==null)) super.setVerticalTextPosition(_htp); else delegate_.setVerticalTextPosition(_htp); }
JLabel label = new JLabel(); label.setIcon(UIManager.getIcon("OptionPane.errorIcon")); label.setText("My Text"); label.setHorizontalTextPosition(JLabel.CENTER); label.setVerticalTextPosition(JLabel.CENTER);
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);
JLabel label = new JLabel(new ImageIcon(new URL(DECK_URL))); label.setText("DECK"); label.setHorizontalTextPosition(JLabel.CENTER); label.setVerticalTextPosition(JLabel.BOTTOM);
JLabel label1 = new JLabel( new ImageIcon(...) ); label1.setText( "Centered Text" ); label1.setHorizontalTextPosition(JLabel.CENTER); label1.setVerticalTextPosition(JLabel.CENTER);
JLabel label = new JLabel( new ShapeIcon(...) ); label.setText( "Centered Text" ); label.setHorizontalTextPosition(JLabel.CENTER); label.setVerticalTextPosition(JLabel.CENTER);
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 ); } }
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; }
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); }