I have created a JList through
IDE. The list have been declared as,
private javax.swing.JList jList1;
now i want to add data to the list, i have a
string array in which i have the values, but when i try adding by using the following,
for(int i=0;i<=5;i++)
jList1.add(i,tmpArrya[i]);
no suitable method found for add(int,java.lang.String)
method java.awt.Container.add(java.awt.Component,java.lang.Object,int) is not applicable
(actual and formal argument lists differ in length)
method java.awt.Container.add(java.awt.Component,java.lang.Object) is not applicable
(actual argument int cannot be converted to java.awt.Component by method invocation conversion)
method java.awt.Container.add(java.awt.Component,int) is not applicable
(actual argument int cannot be converted to java.awt.Component by method invocation conversion)
method java.awt.Container.add(java.lang.String,java.awt.Component) is not applicable
(actual argument int cannot be converted to java.lang.String by method invocation conversion)
method java.awt.Container.add(java.awt.Component) is not applicable
(actual and formal argument lists differ in length)
method java.awt.Component.add(java.awt.PopupMenu) is not applicable
(actual and formal argument lists differ in length)
I am not sure of what half of it means either. How will I be able to add the values to the list dynamically??
Any help will be greatly appreciated.