A suggested answer follows:
The setBackground()
method
is a member method of
the content panel of the frame.
So to use it in the constructor for Repeater
,
you must first get the content panel (as below).
public Repeater() // constructor
{
getContentPane().setLayout( new FlowLayout() );
getContentPane().add( inLabel ) ;
getContentPane().add( inText ) ;
getContentPane().add( outLabel ) ;
getContentPane().add( outText ) ;
getContentPane().setBackground( Color.green );
outText.setEditable( false );
inText.addActionListener( this );
}
. . . . . .