I have this problem, that whenever I set the frame size using the setSize () method the size inside the frame is actually smaller, because the frame size is included in this dimension. My question is how would I make it so that the inside of the frame is the size that I specify?
sirlink99 56 Practically a Master Poster
Recommended Answers
Jump to PostA JFrame consists of a Content Pane surrounded by borders etc and, as you have observed, its size includes the (system-dependent) borders.
To achieve your desired result, set the (preferred) size of the JFrame's Content Pane (access it via myFrame.getContentPane()) rather than the JFrame itself.
Jump to PostSorry mKorbel, I don't think describing another's post as "useless" three times meets this forum's standards for courtesy, but I'm not going to hijack the OPs thread for an argument on this.
@sirliknk99: Frankly I don't understand mKorbel's post. but I stand by what I said. Good luck.
…
Jump to PostYes, the serial ID and runnable would be used in a real app- I left them out because they weren't essential to the demo point.
But, by removing the getContentPane on your line 21 you have broken it. It's now 150x150 including the frame. The whole point of this is …
All 12 Replies
mKorbel 274 Veteran Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
mKorbel 274 Veteran Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

hfx642
sirlink99 56 Practically a Master Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
mKorbel 274 Veteran Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
mKorbel 274 Veteran Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.