Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.awt.Dimension;

import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;

public class Main {
    public static void main(String[] args) {
        JLabel image = new JLabel("java2s.com");
        image.setPreferredSize(new Dimension(2000, 2000));
        JScrollPane js = new JScrollPane(image);

        js.setPreferredSize(new Dimension(200, 200));

        JOptionPane.showMessageDialog(null, js);

    }
}