Skip to main content



      Home
Home » Archived » Eclipse Examples » SWT Section can have focus(SWT Section can have focus)
SWT Section can have focus [message #735699] Wed, 12 October 2011 10:56
Eclipse UserFriend
I have created a section in my project..
If section got focus i have to write some code.
If section lost focus i have to write some other code.



My Code :

FormToolkit toolkit = new FormToolkit(display);
Section section = toolkit.createSection(shell, Section.DESCRIPTION | Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);

section.setText("This is the title");
section.setDescription("-= This is a description -=");

Composite sectionComposite = toolkit.createComposite(section);
sectionComposite.setLayout(new GridLayout(2, false));

section.addFocusListener(new FocusListener() {

@Override
public void focusLost(FocusEvent e) {
System.err.println("Section is focused lost");
}

@Override
public void focusGained(FocusEvent e) {
System.err.println("Section is focused");
}
});
section.setClient(sectionComposite);


When running this code i couldnt find focusgain or focuslost for section...
whether section will have focus?
Previous Topic:Server Adapter for Orion Server
Next Topic:How to work with certificates in Eclipse?
Goto Forum:
  


Current Time: Mon Mar 17 18:39:58 EDT 2025

Powered by FUDForum. Page generated in 0.23583 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top