//class A
void sqlconnection1(){
JOptionPane.showMessageDialog( this,"1");
StorageDataSet storageDataSet1=queryDataSet1;
jdbTable1.setDataSet(storageDataSet1);
添加 g=new 添加();
storageDataSet1.goToRow(0);
storageDataSet1.insertRow(false);
storageDataSet1.setString("编号",g.getbianhao());
}
//监听器
public void jButton1_actionPerformed(ActionEvent e) {
添加 g=new 添加();
g.show(); }
___________________________________________________________//class 添加
public void jButton1_actionPerformed(ActionEvent e) {
MainFrame1 f=new MainFrame1();
f.sqlconnection1();}
public String getbianhao(){
getactioncode();
String bianhao=编号.getText();
return bianhao;
}功能是 点击A中的jbutton1后弹出添加的窗口,写完信息后,按下确定(class添加中的jbutton1)
用getText()获得所填信息,然后在添加到数据库中去
可是在sqlconnection1中,g.getbianhao()这个值为什么会返回空呢?
有什么解决的办法没?
void sqlconnection1(){
JOptionPane.showMessageDialog( this,"1");
StorageDataSet storageDataSet1=queryDataSet1;
jdbTable1.setDataSet(storageDataSet1);
添加 g=new 添加();
storageDataSet1.goToRow(0);
storageDataSet1.insertRow(false);
storageDataSet1.setString("编号",g.getbianhao());
}
//监听器
public void jButton1_actionPerformed(ActionEvent e) {
添加 g=new 添加();
g.show(); }
___________________________________________________________//class 添加
public void jButton1_actionPerformed(ActionEvent e) {
MainFrame1 f=new MainFrame1();
f.sqlconnection1();}
public String getbianhao(){
getactioncode();
String bianhao=编号.getText();
return bianhao;
}功能是 点击A中的jbutton1后弹出添加的窗口,写完信息后,按下确定(class添加中的jbutton1)
用getText()获得所填信息,然后在添加到数据库中去
可是在sqlconnection1中,g.getbianhao()这个值为什么会返回空呢?
有什么解决的办法没?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货