# Use javax.swing

**URL:** <https://discourse.processing.org/t/use-javax-swing/17669>\
**Category:** Coding Questions\
**Created:** [February 9, 2020, 5:31pm UTC](https://discourse.processing.org/t/use-javax-swing/17669 "2020-02-09T17:31:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![creepercrack](https://avatars.discourse-cdn.com/v4/letter/c/3bc359/32.png) [@creepercrack](https://discourse.processing.org/u/creepercrack)\
**Post date:** [February 9, 2020, 5:31pm UTC](https://discourse.processing.org/t/use-javax-swing/17669/1 "2020-02-09T17:31:52Z")

</div>

Hi

Just some questions regarding using `swing`:  
I want to make a sketch that uses `javax.swing` for the ui buttons and stuff:  
Does processing have a default `JFrame` tha I should use (the one I’m interested in)?  
I have to make one myself and add it to processing (if the avobe isn’t possible)?  
Do I have to make a java program and insert `Processing` into a `JPanel` (this one would be less ideal)?  
Is there any other simple or better way (maybe a library)?

Thank you for your time and have a nice day :­)

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [February 9, 2020, 5:39pm UTC](https://discourse.processing.org/t/use-javax-swing/17669/2 "2020-02-09T17:39:47Z")

</div>

You can check previous post in the forum with the keyword JFrame. For instance, I found this one:

> [@Show an desktop menu bar](https://discourse.processing.org/t/show-an-desktop-menu-bar/9651/3):
>
> thanks, but here ( Raspberry Pi ) i must use // frame = (JFrame) (processing.awt.PSurfaceAWT.SmoothCanvas)app.getSurface().getNative()).getFrame(); frame = (JFrame) ((processing.awt.PSurfaceAWT.SmoothCanvas)app.getSurface().getNative()).getFrame(); and in setup to see something, like void setup() { size(500,500); buildMenuBar(); } [2019-03-27\_00-04-50\_snap]

Kf

---

<div class="post-metadata">

**Author:** ![creepercrack](https://avatars.discourse-cdn.com/v4/letter/c/3bc359/32.png) [@creepercrack](https://discourse.processing.org/u/creepercrack)\
**Post date:** [February 9, 2020, 6:45pm UTC](https://discourse.processing.org/t/use-javax-swing/17669/3 "2020-02-09T18:45:13Z")

</div>

Thank you very much, I finally opted for G4P, which is a good library with a grapical editing tool for UIs  
This is it’s reference: “[http://www.lagers.org.uk/g4p/ref/index.html](http://www.lagers.org.uk/g4p/ref/index.html)”  
It comes with all the basic UI things like buttons, text fields, sliders; and some advanced elements like 2D sliders or knobs  
It’s also very intuitive and very easy to use
