Created
February 3, 2015 16:25
-
-
Save skd1993/6dbc43ba32ad95adc35c to your computer and use it in GitHub Desktop.
Create Lable for Image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected JLabel createLabelForImage(BufferedImage im) { | |
JLabel label = new JLabel(new ImageIcon(im)); | |
label.setVerticalAlignment(JLabel.TOP); | |
label.setHorizontalAlignment(JLabel.CENTER); | |
label.setOpaque(true); | |
label.setBounds(0, 0, im.getWidth(), im.getHeight()); | |
return label; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment