# How are closeView and openView implemented and called?

**URL:** https://forum.universal-robots.com/t/how-are-closeview-and-openview-implemented-and-called/38758
**Category:** Java
**Created:** [February 24, 2025, 10:56pm UTC](https://forum.universal-robots.com/t/how-are-closeview-and-openview-implemented-and-called/38758 "2025-02-24T22:56:02Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![elliot.mccormick](https://avatars.discourse-cdn.com/v4/letter/e/3be4f8/32.png) [@elliot.mccormick](https://forum.universal-robots.com/u/elliot.mccormick)
#### Post date: [February 24, 2025, 10:56pm UTC](https://forum.universal-robots.com/t/how-are-closeview-and-openview-implemented-and-called/38758/1 "2025-02-24T22:56:02Z")

</div>

I am hoping someone will be able to elucidate the deeper workings of closeView and openView so that I could attempt to make sense of some seemingly bizarre behavior I am observing in my URCap. I am running into an issue where my closeView appears to be called before my openView. It is an odd case, but some residuals of our view remained when switching from the program tab to the move tab. From the debugging we have done so far, it appears that the closeView was actually getting called before the openView. Any and all thoughts are appreciated. Thank you!

---

<div class="post-metadata">

### Author: ![eric.feldmann](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@eric.feldmann](https://forum.universal-robots.com/u/eric.feldmann)
#### Post date: [February 24, 2025, 11:00pm UTC](https://forum.universal-robots.com/t/how-are-closeview-and-openview-implemented-and-called/38758/2 "2025-02-24T23:00:10Z")

</div>

I’ve noticed that certain actions don’t trigger closeView. Making a call to the robotMovementCallback for position saving for example doesn’t actually trigger the closeView method. Otherwise the closeView is called when the node leaves the active screen, and openView is called when it enters the screen. Are you creating some custom JFrames or something? Generally nothing should even be displayed from the URCAP on the Move screen.

---

<div class="post-metadata">

### Author: ![elliot.mccormick](https://avatars.discourse-cdn.com/v4/letter/e/3be4f8/32.png) [@elliot.mccormick](https://forum.universal-robots.com/u/elliot.mccormick)
#### Post date: [February 25, 2025, 3:13pm UTC](https://forum.universal-robots.com/t/how-are-closeview-and-openview-implemented-and-called/38758/3 "2025-02-25T15:13:09Z")

</div>

Yes, I’ve noticed that as well about the robotMovementCallback. I agree nothing should be able to be displayed from the URCap on the Move screen, that is why I am perplexed. I would have expected the openView and closeView calls to be done via the Swing Event Dispatch Thread, and therefore never executed out of order, but our logs appear to be indicative of the contrary.

---

<div class="post-metadata">

### Author: ![eric.feldmann](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@eric.feldmann](https://forum.universal-robots.com/u/eric.feldmann)
#### Post date: [February 25, 2025, 4:01pm UTC](https://forum.universal-robots.com/t/how-are-closeview-and-openview-implemented-and-called/38758/4 "2025-02-25T16:01:34Z")

</div>

Are you in Polyscope 5 or Polyscope X development?

---

<div class="post-metadata">

### Author: ![elliot.mccormick](https://avatars.discourse-cdn.com/v4/letter/e/3be4f8/32.png) [@elliot.mccormick](https://forum.universal-robots.com/u/elliot.mccormick)
#### Post date: [February 25, 2025, 4:06pm UTC](https://forum.universal-robots.com/t/how-are-closeview-and-openview-implemented-and-called/38758/5 "2025-02-25T16:06:21Z")

</div>

This is for Polyscope 5

---

<div class="post-metadata">

### Author: ![eric.feldmann](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@eric.feldmann](https://forum.universal-robots.com/u/eric.feldmann)
#### Post date: [February 25, 2025, 4:21pm UTC](https://forum.universal-robots.com/t/how-are-closeview-and-openview-implemented-and-called/38758/6 "2025-02-25T16:21:08Z")

</div>

Might help if you post some code. Honestly I rarely use the closeView() method. And I’ve never had UI elements carry over between screens like you’re describing.
