Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.awt.Color;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;

public class Main {
    public static void main(String... args) throws Exception {
        JPanel panel = new JPanel();
        panel.setOpaque(true);
        panel.setBackground(Color.RED);

        java.net.URL url = new java.net.URL("http://www.java2s.com/style/download.png");
        ImageIcon image = new ImageIcon(url);
        JLabel label = new JLabel("LABEL", image, JLabel.RIGHT);
        panel.add(label);

        JOptionPane.showMessageDialog(null, panel, "Modified JOptionPane : ", JOptionPane.PLAIN_MESSAGE);
    }

}