This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I recognized a confusing behavior by using two TopComponents in different invokeLater. Example in Scala: val f1 = new TopComponent { setName("f1") } val f2 = new TopComponent { setName("f2") } SwingUtilities.invokeLater(new Runnable { def run { f1.open }}) SwingUtilities.invokeLater(new Runnable { def run { f2.open }}) Afer running the both TopComponents switching nonstop his focus against: f1 -> f2 -> f1 -> ... If I use a Thread.sleep(5000) between first invokeLater and the second. Then this strange behavior doesn't happen. I found out that this behavior is a result of the tc.requestActive(); in the TopComponent.java file. More Precisely in the topComponentOpen function.
Sorry, I mean the file DummyWindowManager.java
Well, the tc.requestActive() is not the real problem. I found out that it's the f.toFront(); in the DummyWindowManager.java file. If I wrap the f.toFront in a comment block. Then all works fine. Example: protected void topComponentRequestActive(TopComponent tc) { JFrame f = (JFrame) SwingUtilities.getAncestorOfClass(JFrame.class, tc); /* if (f != null) { f.toFront(); } */ registry().setActive(tc); activateComponent(tc); }
Any special reason to use DummyWindowManager?