Hello ! I am new to swing...and I need to add String array items in list box control in java frame form.
whatever code I write but none of the items are displayed in JList control at run time. The code I am writing is :-
String[] data = {"one", "two", "free", "four"};
JList dataList = new JList(data);
no error appears but also no items added in the list. list appears empty. plzz help as soon as poss.
Is threre anything like jpanel or internal frame or such things hv to be added first and then list control ?
PROBLEM WITH JList CONTROL
Started by fas, Sep 28 2010 01:22 AM
2 replies to this topic
#1
Posted 28 September 2010 - 01:22 AM
|
|
|
#2
Posted 28 September 2010 - 07:15 PM
Works fine for me. Did you add the JList to the JFrame's content pane? Could you show us the code you used, because this looks like the sample code used in the JList documentation.
Wow I changed my sig!
#3
Posted 29 September 2010 - 06:19 AM
hello zekedragon !
thanks 4 replying...
yaa here I am attaching my code..I hv put comments somewhere those code r not necessary for solving this part. error and some code is extra which I will require later..so
u plz try to solve this error..I dont know much how to put swing controls ? I mean in panel, jpanel or jframe or whatever else...Right now I have used one JFrame form, upon it I hv put one jPanel2 control and upon it I have put other swing controls like buttons and JList..
:confused:
thanks 4 replying...
yaa here I am attaching my code..I hv put comments somewhere those code r not necessary for solving this part. error and some code is extra which I will require later..so
u plz try to solve this error..I dont know much how to put swing controls ? I mean in panel, jpanel or jframe or whatever else...Right now I have used one JFrame form, upon it I hv put one jPanel2 control and upon it I have put other swing controls like buttons and JList..
:confused:


Sign In
Create Account

Back to top










