在主frame中写个方法,
方法中,jlabel.setText("new string");
然后调用这个方法就可以了

解决方案 »

  1.   

    to:geyf
    我试了,不行,除非调用show()方法才能正常显示,可是界面上出现两个相同的FRAME,一个LABEL值已经改变,一个没有改变。
    to trust_me:
    你的方法好象不行哦还有高招吗
      

  2.   

    不知道你怎么做的,我刚才试了,下面的没有问题:
    比如主frame为:MainFrame,其中包括
    public static JLabel jLabel=new JLabel();
    ....
    public static void setLabel(String _s){
     jLabel.setText(_s);
    }
    在另一个类中,用MainFrame.setText("test");就可以了,不用show();