add swing code sample