• Post Reply Bookmark Topic Watch Topic
  • New Topic

Dynamic Menu Item List  RSS feed

 
Ranch Hand
Posts: 99
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a program where users can create records in a Database (there will only be a few of this particular record - under 10). I want to be able to create a menu item for each of these records (already done using a foreach loop), so that I can then open a new JFrame (which contains a table) with all of the information that this record contains. I am having difficulty making the correct item open the JFrame with the correct object parameter. Here is some code to feast your eyes upon:




Inside the ActionListener, I want to instantiate a JFrame that takes a parameter subAccount (located in that ArrayList and again in the Object[]. I know that the Object[] is a bit superfluous at the moment, but it is there because of me playing with possible ideas.

So, the quesiton is, how can I access the correct object from within the listener?

Thanks in advance,

Greg
 
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make the reference final.
 
Greg Reeder
Ranch Hand
Posts: 99
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!