Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  jlistbox
Language: JAVA
Code:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.event.*;

public class createlist {

    public static void main(String[] args) {
        String s[]={"math","calc","eng"};
     JFrame fm=new JFrame("List Box");
     JPanel p=new JPanel();
     fm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     JList list=new JList(s);
     p.add(list);
     fm.add(panel);
     fm.setSize(400,400);
     fm.setVisible(true);
    }

}          
Comments: