NextGen Consulting

IT Consulting CRM BSS OSS

Implementing ‘Got_focus’ Event in Smart Client

Q: Clear Basic provide ‘got_focus’ event for controls but I can’t find the same event in smart client.
Is there any way to implement this feature in smart client?

   

A: You can add your native contol focus event listeners (lost/gained) as follows:
(assuming your control is a textBox named ‘txtCustomerName’)

// Add the following in the form_Load() event handler:  
// define focus event listeners (lost/gained)  
(    (javax.swing.JComponent)this.txtCustomerName.getNativeControl())
             .addFocusListener(new FocusListener()   
{    
// this is the equivalent to Clear Basic Lost_Focus() 
public void focusLost(FocusEvent focusEvent)
{       
// your logic here... 
System.out.println("focus lost");
}    
// this is the equivalent to Clear Basic Got_Focus() 
public void focusGained(FocusEvent focusEvent)
{
// your logic here... 
System.out.println("got focus");
}   
}   

);

Advertisements

01/10/2010 - Posted by | Amdocs, CRM, CRM, Development, Front End, Smart Client, Technology

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: