2
0

New user fixes.

This commit is contained in:
Maarten Billemont
2018-07-28 19:56:20 -04:00
parent 38f09021b3
commit 978b758079
8 changed files with 93 additions and 92 deletions

View File

@@ -90,7 +90,7 @@ public class CollectionListModel<E> extends AbstractListModel<E>
@Override
@SuppressWarnings({ "unchecked", "SuspiciousMethodCalls" })
public synchronized void setSelectedItem(@Nullable final Object newSelectedItem) {
if (!Objects.equals( selectedItem, newSelectedItem ) && model.contains( newSelectedItem )) {
if (!Objects.equals( selectedItem, newSelectedItem )) {
selectedItem = (E) newSelectedItem;
fireContentsChanged( this, -1, -1 );

View File

@@ -431,8 +431,9 @@ public class UserContentPanel extends JPanel implements FilesPanel.Listener, MPU
Toolkit.getDefaultToolkit().getSystemClipboard().setContents( clipboardContents, null );
Res.ui( () -> {
Window window = SwingUtilities.windowForComponent( this );
window.dispatchEvent( new WindowEvent( window, WindowEvent.WINDOW_CLOSING ) );
Window window = SwingUtilities.windowForComponent( UserContentPanel.this );
if (window != null)
window.dispatchEvent( new WindowEvent( window, WindowEvent.WINDOW_CLOSING ) );
} );
} );
}