|
Re: embedded method [message #794600 is a reply to message #794395] |
Thu, 09 February 2012 13:35 |
|
You might get an answer here from someone, however, this isn't a Java
forum. Academically, you're better off asking such questions in another
such as javaranch.com or jguru.com.
I think your thing falls in the area of what's termed in Java "anonymous
classes", but I'm not very academic in Java.
On 2012.02.09 1:30, auger pierre wrote:
> Hi;
> i don't understand the code
> Quote:
>> play= new AbstractAction() {
>>
>> public void actionPerformed(ActionEvent arg0) {
>>
>> player.init();
>> audioPlayerThread = new Thread(player);
>> audioPlayerThread.start();
>> player.getLine().addLineListener(new LineListener(){
>>
>> public void update(LineEvent le) {
>> if(le.getType()==LineEvent.Type.STOP){
>> play.setEnabled(true);
>> stop.setEnabled(false);
>>
>>
>> }
>> if(le.getType()==LineEvent.Type.START){
>> play.setEnabled(false);
>> stop.setEnabled(true);
>>
>> }
>> }
>> });
>>
>> }
>> };
>
> and i don't find in the java books :the definition of the method
> actionPerformed is inside the method AbstractAction with a semicolonat
> its end in the AbstractAction ,
> i am newcommer to java but i never saw such a programming
> thank you for help
|
|
|
Powered by
FUDForum. Page generated in 0.29153 seconds