# Getting A Sketch's Window's Position

**URL:** https://discourse.processing.org/t/getting-a-sketchs-windows-position/31772
**Category:** Coding Questions
**Created:** [August 18, 2021, 4:30am UTC](https://discourse.processing.org/t/getting-a-sketchs-windows-position/31772 "2021-08-18T04:30:15Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)
#### Post date: [August 22, 2021, 10:06pm UTC](https://discourse.processing.org/t/getting-a-sketchs-windows-position/31772/6 "2021-08-22T22:06:38Z")

</div>

> [@Get location of a PApplet window](https://discourse.processing.org/t/get-location-of-a-papplet-window/28039/10):
>
> PVector getWindowLocation() { PVector windowLocation = new PVector(); switch (sketchRenderer()) { case P2D: case P3D: com.jogamp.nativewindow.util.Point p = new com.jogamp.nativewindow.util.Point(); ((com.jogamp.newt.opengl.GLWindow) surface.getNative()).getLocationOnScreen(p); windowLocation.x = p.getX(); windowLocation.y = p.getY(); break; case FX2D: final processing.javafx.PSurfaceFX FXSurface = (processing.javafx.PSurfaceFX) surface; final javafx.sce…

---

_[View the full topic](https://discourse.processing.org/t/getting-a-sketchs-windows-position/31772)._
