开发者

How to set Location of Message Dialog in java?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜