2016-05-29 35 views

答えて

1

JFrameは、方法はJavadocのからgetInsets()

と呼ばれています

getInsets 
public Insets getInsets() 

Determines the insets of this container, which indicate the size of the container's border. 
A Frame object, for example, has a top inset that corresponds to the height of the frame's title bar. 
1

あなたが使用して、代わりに、コンテンツは独自のサイズを決定することができ、フレーム自体の大きさを気にしてはいけませんレイアウト管理APIを呼び出して、フレーム境界の装飾を自動的に考慮に入れて、フレームを囲むJFrame#packを呼び出します。

+0

おそらくほとんどの場合正しいかもしれませんが、有効ではないとは言えませんこれをやりたいと思っています。 –

+0

@A.Grandt Do what?ビューのコンテンツの周りにフレームをラップしますか? * "私は' null'レイアウト "*を使用しています(ちょっと前に見てみましょう)。その後、' getPreferredSize'をオーバーライドし、表示させたい領域のサイズを返します。フレームのインセット:P – MadProgrammer

関連する問題