Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.SwingConstants;

public class Main {
    public static void main(final String args[]) {
        JButton button = new JButton("Test");

        button.setHorizontalTextPosition(SwingConstants.LEFT);
        button.setIcon(new ImageIcon("r.gif"));
        button.setRolloverIcon(new ImageIcon("b.gif"));
        button.setRolloverEnabled(true);

        JOptionPane.showMessageDialog(null, button);
    }
}