summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-over-gui/src/main/java')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java
index 8f90cd78..1ca05015 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java
@@ -195,15 +195,19 @@ public class PositioningComposite extends StateComposite {
getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
- PositioningComposite.this.mainArea.setFocus();
- EventQueue.invokeLater(new Runnable() {
- @Override
- public void run() {
- if(!PositioningComposite.this.frame.hasFocus()) {
- PositioningComposite.this.frame.requestFocus();
+ if (!PositioningComposite.this.isDisposed() && !PositioningComposite.this.mainArea.isDisposed()) {
+ PositioningComposite.this.mainArea.setFocus();
+ EventQueue.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ if (!PositioningComposite.this.isDisposed()) {
+ if(!PositioningComposite.this.frame.hasFocus()) {
+ PositioningComposite.this.frame.requestFocus();
+ }
+ }
}
- }
- });
+ });
+ }
}
});
}