[JAVA] Bureau: Gui afficher l'image

Goal
Load a image with OpenCV.

Gui_Show_Image.java


mport javax.swing.*;
import java.awt.*;

public class Gui_Show_Image {

    private JFrame frame;

    /**
     * Launch the application.
     */
    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                try {
                    Gui_Show_Image window = new Gui_Show_Image();
                    window.frame.setVisible(true);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
    }

    public Gui_Show_Image() {
        initialize();
    }
    /**
     * Initialize the contents of the frame.
     */
    private void initialize() {
        frame = new JFrame();
        frame.setBounds(100, 100, 450, 300);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().setLayout(null);

        JLabel lblNewLabel = new JLabel("");
        lblNewLabel.setIcon(new ImageIcon("C:\\Users\\koinPC\\Pictures\\dance2.png "));
        lblNewLabel.setBounds(14, 0, 159, 240);
        frame.getContentPane().add(lblNewLabel);
    }
}
Result
![ShowImage.JPG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/276243/99b9dd04-9144-e5be-02fc-4b3ececb70fb.jpeg)

Recommended Posts

Bureau: Gui afficher l'image
Bureau: curseur Gui
Bureau: bouton Gui
Bureau: OpenCV Sharpness Gui
Bureau: redimensionner l'image OpenCV
Bureau: image OpenCV Flip
Bureau: OpenCV Rotate image
Bureau: OpenCV Gui modifie la luminosité
Bureau: OpenCV Merge Two Image
Bureau: OpenCV Show Stylisation par WebCam
Bureau: OpenCV Gui change chaque pixel
Afficher l'aperçu lors de la modification de l'image de l'utilisateur