Java tutorial
//package com.java2s; //License from project: Apache License import java.awt.image.BufferedImage; import javax.swing.ImageIcon; import javax.swing.JComponent; import javax.swing.JLabel; public class Main { public static JLabel toSwingImage(final BufferedImage image) { JLabel label = new JLabel(new ImageIcon(image)); label.setAlignmentX(JComponent.CENTER_ALIGNMENT); return label; } }