dialog.hide();
dialog.setVisible(false);
                public void keyPressed( KeyEvent event ) {                    if ( KeyEvent.VK_ENTER == event.getKeyCode() ||                         KeyEvent.VK_SPACE == event.getKeyCode() ) {                        Dimension size = imgButton.getPreferredSize();                        camo.setBackground( imgButton.getBackground() );                        camo.setLabel( imgButton.getLabel() );                        camo.setImage( imgButton.getImage()                                       .getScaledInstance(size.width,                                                          size.height,                                                          Image.SCALE_FAST) );                        dialog.hide();                    }                }