mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
26 lines
521 B
Java
26 lines
521 B
Java
|
|
import javax.swing.*;
|
|
import java.awt.event.ActionEvent;
|
|
|
|
public class ExtractMethods { }
|
|
abstract class MyButton
|
|
extends JButton
|
|
{
|
|
protected MyButton( String text ) {
|
|
super( text );
|
|
}
|
|
}
|
|
class Foo {
|
|
private JButton createOKButton() {
|
|
return new MyButton( "OK" ) {
|
|
public void actionPerformed( ActionEvent e ) {
|
|
newMethod();
|
|
}
|
|
|
|
private void newMethod() {
|
|
setVisible( false );
|
|
}
|
|
};
|
|
}
|
|
}
|