This is probably Java.
Just replace the brackets { } by begin end and you're very close to Delphi anyhow
Should be OK to understand the basic procedures needed.
The basic steps are described there, you can try to find the similar classes in Delpi source.
Rollo