Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;

public class Main {
    public static void main(String[] args) {
        String[] items = { "1|9|2", "1|9|1", "1|4|7" };
        JList list = new JList(items);
        JPanel panel = new JPanel();
        panel.add(new JScrollPane(list));
        JOptionPane.showMessageDialog(null, panel);
    }
}