List of usage examples for javax.swing JLabel setVerticalTextPosition
@BeanProperty(expert = true, visualUpdate = true, enumerationValues = { "SwingConstants.TOP", "SwingConstants.CENTER", "SwingConstants.BOTTOM" }, description = "The vertical position of the text relative to it's image.") public void setVerticalTextPosition(int textPosition)
From source file:com.enderville.enderinstaller.ui.Installer.java
protected void initialPanel(JPanel contentPane) { JLabel text = new JLabel(); try {/* w ww . j a va 2 s . c o m*/ ImageIcon icon = new ImageIcon(ImageIO.read(new FileInputStream(InstallerConfig.getLogoFile()))); text.setIcon(icon); } catch (IOException e) { LOGGER.error("IO error on logo.png", e); } StringBuilder textBuffer = new StringBuilder(); try { BufferedReader r = new BufferedReader(new FileReader(InstallerConfig.getInitTextFile())); String line = null; while ((line = r.readLine()) != null) { textBuffer.append(line + "\n"); } } catch (IOException ioe) { LOGGER.error("IO error on logo.png", ioe); } text.setText(textBuffer.toString()); text.setVerticalTextPosition(JLabel.BOTTOM); text.setHorizontalTextPosition(JLabel.CENTER); contentPane.setLayout(new MigLayout(new LC().fill())); contentPane.add(text, new CC().alignX("center").wrap()); contentPane.add(getTargetButton(), new CC().alignX("center").wrap()); }