Hi guys,
with event handlings it seems that there are 2 approaches:
1)using an anonymous inner class
2)using a normal inner class.
From what I can see if you have more than one component that is generating an event, say you have 3 buttons, if you go down the route of anonymous inner classes then you need to have effectively 3 inner classes, one for each component. If you instead use a normal - I call it normal, not sure what's the right name for it - inner class then you could techincally use only one.
So, what's better? My understanding is that anonymous inner classes are more widely used because there is less code to write, that's if you use 1, but that might not be the case. What do you guys say? I'm writing a little simple application with three buttons, and I'm thinking not to use an anonymous inner class.
thanks
Violet_82 89 Posting Whiz in Training
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
Violet_82 89 Posting Whiz in Training
stultuske 1,116 Posting Maven Featured Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
Violet_82 89 Posting Whiz in Training
stultuske 1,116 Posting Maven Featured Poster
Violet_82 89 Posting Whiz in Training
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
Violet_82 89 Posting Whiz in Training
stultuske 1,116 Posting Maven Featured Poster
Violet_82 89 Posting Whiz in Training
Violet_82 89 Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.