To show list of items in java swing, we have a javax.swing.JList component.
Following steps needed to create list
1. Create list of items as String array.
2. Create instance of a JPanel
3. create the object of JList by passing items array as parameter to its constructor.
4. Now add the instance of JList to panel.
5. add the panel to your frame
6. set the size and visibility of your frame.
7. Test your program.
or watch the following video that i have uploaded for easy reference.
Following steps needed to create list
1. Create list of items as String array.
2. Create instance of a JPanel
3. create the object of JList by passing items array as parameter to its constructor.
4. Now add the instance of JList to panel.
5. add the panel to your frame
6. set the size and visibility of your frame.
7. Test your program.
or watch the following video that i have uploaded for easy reference.
I have read your blog its very attractive and impressive. I like it your blog.
ReplyDeleteJava Training in Chennai Java Training in Chennai | Core Java Training in Chennai | Java Training Institutes
Online Java Training Java Online Training | Java J2EE Online Training | JavaEE Training Institute in Chennai