document.setTitle(String.valueOf(getTitle()));
document.setIcon(IconCache.get(String.valueOf(getIcon())));
document.setComponent(this);
// add closing method
document.addDocumentComponentListener(new DocumentComponentAdapter() {
@Override
public void documentComponentClosing(final DocumentComponentEvent e) {
document.setAllowClosing(closeTab());