Make a camera with changeable size

Hello!
What would be the easiest way to create a game with a camera that supports operations like zooming in/ out. So if you would like to see more of the world, then you would increase the size of camera’s viewport. I had an idea of rendering the world on an off-screen BufferedImage and then just drawing it and setting it’s width and height to the JFrame’s, but I don’t know if that would work.

Thanks.

Why not just use JOGL/LWJGL/libGDX?

So many +1 to @KevinWorkman.

But to answer your question, it depends on the type of camera you are talking about. If you are talking first person then no. But I presume you aren’t talking that. If it’s 2D platformer or in fact anything 2D then yes.

However will not be efficient. I’ve never worked with Java2D for games but I would guess you would have to mess around with he transform associated with the Graphics object. Someone who knows what they’re talking about can confirm or not that.