开发者

How to set Location of Message Dialog in java?

开发者 https://www.devze.com 2022-12-22 04:38 出处:网络
In java, message dialogs open in middle of 开发者_开发知识库the Frame window by default in java. I want open the message dialog in specified location. Is it possible.? Yes is it possible using the set

In java, message dialogs open in middle of 开发者_开发知识库the Frame window by default in java. I want open the message dialog in specified location. Is it possible.?


Yes is it possible using the setLocation method:

mydialog.setLocation(200,200);

But you must set the location before set the visible. Swing components can't dynamically re-generated after visibility. Just set the location before set visible to true.

0

精彩评论

暂无评论...
验证码 换一张
取 消