public void setBounds(int x,int y,int width,int height)
-----------
x - the new x-coordinate of this component
y - the new y-coordinate of this component
width - the new width of this component
height - the new height of this component
--------
this.指待当前对象。
--------
true?
pack();
this.setVisible(true); //容器可见
--------不要告诉我你看不懂E文。
-----------
x - the new x-coordinate of this component
y - the new y-coordinate of this component
width - the new width of this component
height - the new height of this component
--------
this.指待当前对象。
--------
true?
pack();
this.setVisible(true); //容器可见
--------不要告诉我你看不懂E文。
//没见过这样设的,呵呵JOptionPane.showMessageDialog(this,"请您输入个整数!");
//this是指父窗口,这里是当前类的实例this.setVisible(true);
//使当前窗口可现,这将触发绘屏方法。
//this是JOptionPane,是当前类的实例this.setVisible(true);
//使当前窗口可现,这将触发绘屏方法 paint()方法!
后一个this,应该都是指的当前的主窗体
第三个是指把主窗体设置为可以显示,否则你看不到它
你该把当前的对象说明贴一下
我比较倾向 cpuzzle(茶壶) 和: gotoidea(索欣) 的意见