主要是jButton4_actionPerformed,如下:
void jButton4_actionPerformed(ActionEvent e) {
  类名.this.search.setText((String)类名.this.jComboBox1.getSelectedItem());
}

解决方案 »

  1.   

    sorry,上面有错,如下:
    void jButton4_actionPerformed(ActionEvent e) {
      this.search.setText((String)this.jComboBox1.getSelectedItem());
    }
      

  2.   

    getSelectedItem()
    public Object getSelectedItem()Returns the current selected item. 
    If the combo box is editable, then this value may not have been added to the combo box with addItem, insertItemAt or the data constructors. 
    Returns:
    the current selected Object
    See Also:
    setSelectedItem(java.lang.Object)
    具体应该写:
    String selection = (String)jComboBox1.getSelectedItem();
    search = selection;
      

  3.   

    原来search是个字符串,不好意思,如下:
    void jButton4_actionPerformed(ActionEvent e) {
      search=(String)this.jComboBox1.getSelectedItem();
    }
      

  4.   

    to  beyond_xiruo(乱谈情) 
    不对呀
    打了this.search.之后并没有弹出setText()的方法呀
    直接copy过去的话错误
    method setText(java.lang.string)not found in java.lang.string
      

  5.   

    beyond_xiruo(乱谈情)
    多谢,已经解决,马上接贴顺便问一下
    把访问本地数据库的程序改称访问局域网中别的数据库的程序很麻烦吗?
    是不是还要重写很多东西呀
      

  6.   

    原则上只需要把数据库的URL提取出来作为一个变量,到时候只需要改动这个变量以及相关的用户名,密码就行了。当然如果你的数据库本身就不同的话,那也不行,还得重新load驱动,并且要考虑到数据库的SQL标准问题。