this.getContentPane().setLayout(xYLayout1);
    this.getContentPane().add(jTextArea1, new XYConstraints(107, 116, 153, 114));

解决方案 »

  1.   

    布局设为null.
    Jpanel panel = new JPanel();
    JTextField txt = new JTextField(10);panel.setLayout(null);
    txt.setBounds(100,100,100,25);
    panel.add(txt);
      

  2.   

    楼上的几位已经回答了,我不说了
    不过我想提醒楼主的是,用这种绝对尺寸有时候会出些问题,最好不要用,界面的布局建议使用布局管理器layoutmanager,这样才能保证界面的相对稳定。。
      

  3.   

    setBounds(...)试过不行啊!this.getContentPane().setLayout(xYLayout1);
    this.getContentPane().add(jTextArea1, new XYConstraints(107, 116, 153, 114));
    不太明。可以详细少少吗?
      

  4.   

    建议使用GRIDBADlAYOUT布局模式要比NULL,和XY...都好
      

  5.   

    this.getContentPane().setLayout(null);
    setBounds(...)
      

  6.   

    getContentPane().add(exitButton);
            exitButton.setBounds(320, 240, 60, 20);setBounds(int X, int Y, 高度, 宽度);
      

  7.   

    引:楼上的几位已经回答了,我不说了
    不过我想提醒楼主的是,用这种绝对尺寸有时候会出些问题,最好不要用,界面的布局建议使用布局管理器layoutmanager,这样才能保证界面的相对稳定。。