mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-18 00:20:54 +07:00
28 lines
554 B
Java
28 lines
554 B
Java
|
|
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( int e ) {
|
|
newMethod();
|
|
}
|
|
|
|
private void newMethod() {
|
|
setVisible( false );
|
|
}
|
|
};
|
|
}
|
|
}
|
|
|
|
class JButton {
|
|
public JButton(String text) {
|
|
}
|
|
public void setVisible(boolean b) {}
|
|
} |