Hey all.I got a question about the use of action listeners.Actually its more about actionEvents.Anyway,my question is: Supposing i have a frame with four buttons,say "A","B","C","D". I want each time i press a different button something different to appear on TextField.I know i can make 4 different button subclasses,each with a different actionPerformed.Or i can make 4 different actionListeners.But i wonder if there is a simpler way to do that,in case i eg have 40 buttons. Can i somehow find out what was the "actionEvent" aka which of the same-but differently named-buttons was pushed?Thanks!
chester1908 0 Newbie Poster
komyg 0 Light Poster
mKorbel 274 Veteran Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
chester1908 0 Newbie Poster
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.