public class Frame1 extends JFrame
{
JTextField text=new JTextField();
public static void main(String[] args)
{
Frame1 test = new Frame1();
}
public Frame1()
{
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.getContentPane().setLayout(new FlowLayout());
this.getContentPane().add(text);
this.setSize(100,100);
new InnerClass();
this.pack();
this.show();
}
class InnerClass
{
public InnerClass()
{
text.setText("set by InnerClass");
}
}
}