I want to make an "Open" and "Save" dialog in java. An example of what I want is in the images below:

Open:

![Open file dialog](https://i.stack.imgur.com/cI3JH.jpg)

Save:

![Save file dialog](https://i.stack.imgur.com/p8MRD.jpg)

How would I go about doing this?