Thread: parent/child
View Single Post
Join Date: Aug 2007
Posts: 225
Reputation: ceyesuma is an unknown quantity at this point 
Solved Threads: 0
ceyesuma ceyesuma is offline Offline
Posting Whiz in Training

Re: parent/child

 
0
  #5
Oct 30th, 2007
Yes. I agree. From now on I plan to do exac tly that. This program is doing just what you explained. But when I click in the file menu "debit","new account" it is listening
and calls debitnewAccount Or (dbnewacctActionPerformed())
  1. private void dbnewacctActionPerformed(java.awt.event.ActionEvent evt) {
  2. jLabel33.setText(evt.getActionCommand());
  3.  
  4. if(evt.getActionCommand().equals("New Account")){
  5. pc.setAcctTypeCode("d");//debit
  6. pc.setAcctStatusCode("n");// new
  7. btnSet();
  8. try {
  9. pc.newAccount();
  10. } catch (FileNotFoundException ex) {
  11. ex.printStackTrace();
  12. } catch (IOException ex) {
  13. ex.printStackTrace();
  14. }
  15. acctjLbl.setText("Debit Account: "+String.valueOf(pc.getAccountNo()));
  16. try {
  17.  
  18. db.setData();
  19.  
  20. } catch (FileNotFoundException ex) {
  21. ex.printStackTrace();
  22. } catch (IOException ex) {
  23. ex.printStackTrace();
  24. } catch (SQLException ex) {
  25. ex.printStackTrace();
  26. } catch (Exception ex) {
  27. ex.printStackTrace();
  28. }finally{
  29. }
  30. try {
  31. debitTemp();
  32. } catch (FileNotFoundException ex) {
  33. ex.printStackTrace();
  34. } catch (SQLException ex) {
  35. ex.printStackTrace();
  36. } catch (IOException ex) {
  37. ex.printStackTrace();
  38. } catch (Exception ex) {
  39. ex.printStackTrace();
  40. }
  41. }
  42. }
first it sets all the buttons and textboxes with
  1. btnSet();
then
  1. pc.newAccount();
this works fine it creates an new account no
but it need to set new data in
  1. db.setData();
there is a similar metod used for credit card processe in creditcard class called
  1. setData();
and these variables should be chaned by db.setData but they don't
then it calls debitTemp()which outputs it to the gui.
[/code]
if i could clidk the menu item debt then new account and have it set data with the DebitCard.java using db.setData(); the rest of the program would work.

I just can't figure the simplest thing "Creating a Debit card .java object that uses the methods of it's parent CreditCard.java but sets the variables relative to debit card.
Last edited by ceyesuma; Oct 30th, 2007 at 5:22 pm.
Reply With Quote