hi.
my problem is not specifically code based. I just want to understand how each Component in Swing & awt (e.g. JButton) can have specific code to execute.
I know a-bit about events and have got all that working, I just don't know how I'm going to differentiate between a user clicking button1 and button2.
They will both send an ActionEvent object to the ActionListener class which then executes the actionPerformed() method, but i want both to do something different! and at the moment they both do the same thing!
Is there a way of identifying a specific and immutable reference when an ActionEvent object is sent which (using 'case' and 'if...else' statements, to differentiate)
Thankyou for all ur help!
Oxy we are all of us living in the gutter.
But some of us are looking at the stars.
my problem is not specifically code based. I just want to understand how each Component in Swing & awt (e.g. JButton) can have specific code to execute.
I know a-bit about events and have got all that working, I just don't know how I'm going to differentiate between a user clicking button1 and button2.
They will both send an ActionEvent object to the ActionListener class which then executes the actionPerformed() method, but i want both to do something different! and at the moment they both do the same thing!
Is there a way of identifying a specific and immutable reference when an ActionEvent object is sent which (using 'case' and 'if...else' statements, to differentiate)
Thankyou for all ur help!
Oxy we are all of us living in the gutter.
But some of us are looking at the stars.