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.
精彩评论