主要是jButton4_actionPerformed,如下:
void jButton4_actionPerformed(ActionEvent e) {
类名.this.search.setText((String)类名.this.jComboBox1.getSelectedItem());
}
void jButton4_actionPerformed(ActionEvent e) {
类名.this.search.setText((String)类名.this.jComboBox1.getSelectedItem());
}
void jButton4_actionPerformed(ActionEvent e) {
this.search.setText((String)this.jComboBox1.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;
void jButton4_actionPerformed(ActionEvent e) {
search=(String)this.jComboBox1.getSelectedItem();
}
不对呀
打了this.search.之后并没有弹出setText()的方法呀
直接copy过去的话错误
method setText(java.lang.string)not found in java.lang.string
多谢,已经解决,马上接贴顺便问一下
把访问本地数据库的程序改称访问局域网中别的数据库的程序很麻烦吗?
是不是还要重写很多东西呀