Making a pointer to objects
I have recently embarked apon a little journey into making a java app because i needed a stand alone application that would run on macs/windows.
It's more of a utility to aid in the creation of an iphone app. (it generates code based on positions of items on scene).
Now, so far, i've got a scrollingPanel, with images inside that, i can track their position, and move them with them with the arrow keys. updating their position to where i need it.
My problem is, i can't seem to work out how to select which image i want to move.
When an item is added into my panel, i add an item to a JList, i was hoping to be able to select an item within this list, and doing so would 'select' that item and let me move it.
I think i can do that, i just need to know how to make a pointer to an object, so in my keypressed codes it would always refer to a pointer called
Whenever i select an item in my JList, i need to be able to say something like
selectedItem = image3;
Have i overlooked something? i can't seem to work out how this is done.
Thanks in advance for any hints, tips or help! :)