• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get ArrayList from another class to show up inside a JComboBox?  RSS feed

 
Pyuntae Chan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to build a program and I am having trouble getting my ArrayList from another class to show up in a JComboBox. My program will look something like this but before where "Melissa" is written, I want to have a JComboBox that has a list of users and be able to select from it to get the results:



Here is my error:


Here is my incomplete code which gives me an error because it cannot locate my arrayList:


Here's my code for another panel that contains the ArrayList


Here's my User class that was used to make the ArrayList:

 
Campbell Ritchie
Marshal
Posts: 55793
164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please sort out the compiler errors first. Then explain where your List is and how you intend to get it into the combo box.
Why don't you have a getPoints method in the User class?
 
Pyuntae Chan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Please sort out the compiler errors first. Then explain where your List is and how you intend to get it into the combo box.
Why don't you have a getPoints method in the User class?


I didn't get to that part yet but I have added it on since I think I got the first part to work. Now i'm confused about how to get the points to actually show up.
Here's my update.







 
Pyuntae Chan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I got the code right after all since it compiles now but it still does not display the points anywhere?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!