我研究过jdk的源码,你要继承一个JOptionPane,改写它的createInternalFrame方法为:
public class MyJOptionPane
{
int x,y;public setX(int _x){ x = _x ; }
public setY(int _y)( y = _y;  }
public JInternalFrame createInternalFrame(Component parentComponent,String title) 
{
     JInternalFrame frame = super.createInternalFrame(parentComponent,title);
     frame.setBounds(x,y,frame.getWidth(),frame.getHeight());
     return frame;
}}
使用的时候,如下:
MyJOptionPane myJOptionPane = new MyJOptionPane();
myJOptionPane.setX(100);
myJOptionPane.setY(200);myJOptionPane.showInputDialog("Pls input value:");