Welcome to Dream.In.Code
Become a Java Expert!

Join 149,948 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,351 people online right now. Registration is fast and FREE... Join Now!




populating combo box selections with NetBeans

 
Reply to this topicStart new topic

populating combo box selections with NetBeans, Need to pull data from an external text file

dgilmore286
15 Sep, 2008 - 07:20 PM
Post #1

D.I.C Head
**

Joined: 9 May, 2007
Posts: 69


My Contributions
Hello all,

I am trying to figure out how I can populate the selections of a JComboBox in NetBeans IDE. I need to have the values for each selection that displays in the combo box retrieved from an external text file. I have the program working if the values are hard coded, I have the program accessing the file and reading the values into an array. What I cannot figure out is how to have NetBeans assign the values from the array to the items to be displayed in the combo box…

Can anyone offer any suggestions?

Thank you!

This post has been edited by dgilmore286: 15 Sep, 2008 - 07:21 PM
User is offlineProfile CardPM
+Quote Post

pbl
RE: Populating Combo Box Selections With NetBeans
15 Sep, 2008 - 07:53 PM
Post #2

D.I.C Lover
Group Icon

Joined: 6 Mar, 2008
Posts: 3,574



Thanked: 233 times
Dream Kudos: 75
My Contributions
QUOTE(dgilmore286 @ 15 Sep, 2008 - 08:20 PM) *

Hello all,

I am trying to figure out how I can populate the selections of a JComboBox in NetBeans IDE. I need to have the values for each selection that displays in the combo box retrieved from an external text file. I have the program working if the values are hard coded, I have the program accessing the file and reading the values into an array. What I cannot figure out is how to have NetBeans assign the values from the array to the items to be displayed in the combo box…

Can anyone offer any suggestions?

Thank you!


Not familiar with Netbeans but you are telling me you cannot create a JComboBox without telling the IDE the values to put in it ? I seriously doubt.

Just create an empty JComboBox without telling Netbeans what to put in it.
Then read your file and addItem(String read) into the Combo

User is online!Profile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 05:26PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month