このコード行に明らかな問題はありますか? ウィンドウのサイズに関係なく、長方形を中央に配置したい。しかし、これは何らかの理由で機能しません。長方形は同じ場所にとどまります。
public void run() {
setSize(800, 800);
createEntireFigure();
}
private void createEntireFigure(){
int centerOfWindowWidth = getWidth() / 2;
int centerOfWindowHeight = getHeight() / 2;
GRectWithGLabel ("A String",centerOfWindowWidth, centerOfWindowHeight);
}