Exemplo

public static void main( String[] args ) {
Frame frame = new Frame( "Peers" );
Button button = new Button( "Hello World!" );
frame.setLayout( new GridLayout() );
frame.add( button );
frame.setVisible( true );
ButtonPeer peer = (ButtonPeer)button.getPeer();
peer.dispose();
}

Solução
Remover chamadas para objectos unidade. Utilizar, em vez disso, interfaces java.awt ou javax.swing e classes.

public static void main( String[] args ) {
Frame frame = new Frame( "Peers" );
Button button = new Button( "Hello World!" );
frame.setLayout( new GridLayout() );
frame.add( button );
frame.setVisible( true );
}