Getting drawable area of a JFrame?

E

Ed Dana

I want the width and height of the _drawable_ area of a JFrame. Not the
entire area, only the area I can draw in.

Any and all clues, as always, greatly appreciated.

Ed.
 
B

Bill Tschumy

I want the width and height of the _drawable_ area of a JFrame. Not the
entire area, only the area I can draw in.

Any and all clues, as always, greatly appreciated.

Ed.

myJFrame.getContentPane().getBounds();
 
E

Ed Dana

Bill said:
myJFrame.getContentPane().getBounds();

Excellent. Thank you. But how do I account for the Title bar? Part of my
image is being overwritten by that.

Ed.
 
A

Andrey Kuznetsov

myJFrame.getContentPane().getBounds();
Excellent. Thank you. But how do I account for the Title bar? Part of my
image is being overwritten by that.
draw your image not on JFrame, but on JFrame's contentPane.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top