How does JBuilder decide which ActionAdapter to use?

C

Chao-Jen Chen

Hi,

I'm curious about the way that the visual designer of JBuilder decides
or picks up which action adapter to use when I double-click on a visual
component. For example, given that JBuilder is configured to take
anonymous adapters for event handling, when I double-click on a
JButton named jButton1, JBuilder generates the following
listener-registering codes inside jbInit().

<CODE>
jButton1.addActionListener(new ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
jButton3_actionPerformed(e);
}
});
</CODE>

I just wonder why JBuilder know that it should take ActionListener,
not any other interface or class, for the anonymous adapter to
implement or inherit.


Chao-Jen Chen
 
T

Tor Iver Wilhelmsen

I just wonder why JBuilder know that it should take ActionListener,
not any other interface or class, for the anonymous adapter to
implement or inherit.

The creators of the visual designers chose that as the "default"/most
likely interface to implement. Also, I guess Delphi etc. do the same
thing.

For other event sets, there is the "event" tab.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top