gatepass system

Reply

Join Date: Aug 2008
Posts: 40
Reputation: coolbuddy059 has a little shameless behaviour in the past 
Solved Threads: 0
coolbuddy059 coolbuddy059 is offline Offline
Light Poster

gatepass system

 
0
  #1
Jun 8th, 2009
I've been writing code to develop gatepass system for my college. I've to made space for taking the photograph of the visitor taken by the camera at gates and then save the whole page in the database(actually the structure is already defined). Please suggest what to do.The code I've made till now is:=


  1. import javax.swing.*;
  2. import java.awt.*;
  3.  
  4. public class gatepass{
  5. public static void main(String[] args){
  6. JLabel visitorid=new JLabel("VISITOR ID",JLabel.CENTER);
  7. JLabel name=new JLabel("NAME",JLabel.CENTER);
  8. JLabel fathername=new JLabel("FATHER'S NAME",JLabel.CENTER);
  9. JLabel contact=new JLabel("CONTACT NO.",JLabel.CENTER);
  10. JLabel address=new JLabel("ADDRESS",JLabel.CENTER);
  11. JLabel meetwhom=new JLabel("MEET WHOM",JLabel.CENTER);
  12. JLabel purpose=new JLabel("PURPOSE",JLabel.CENTER);
  13. JLabel vehicle=new JLabel("VEHICLE",JLabel.CENTER);
  14. JLabel person=new JLabel("NO. OF PERSON",JLabel.CENTER);
  15. JLabel remark=new JLabel("REMARKS",JLabel.CENTER);
  16.  
  17.  
  18. JTextField visitorid1 = new JTextField(7);
  19. JTextField name1 = new JTextField(30);
  20. JTextField fathername1 = new JTextField(30);
  21. JTextField contact1 = new JTextField(10);
  22. JTextField address1 = new JTextField(100);
  23. JTextField meetwhom1 = new JTextField(30);
  24. JComboBox purpose1 = new JComboBox();
  25. purpose1.addItem("personal");
  26. purpose1.addItem("official");
  27. JTextField vehicle1 = new JTextField(100);
  28. JComboBox person1=new JComboBox();
  29. person1.addItem("1");
  30. person1.addItem("2");
  31. person1.addItem("3");
  32. person1.addItem("4");
  33. JTextField remark1 = new JTextField(100);
  34.  
  35.  
  36. visitorid.setLabelFor(visitorid1) ;
  37. name.setLabelFor(name1);
  38. fathername.setLabelFor(fathername1);
  39. contact.setLabelFor(contact1);
  40. address.setLabelFor(address1);
  41. meetwhom.setLabelFor(meetwhom1);
  42. purpose.setLabelFor(purpose1);
  43. vehicle.setLabelFor(vehicle1);
  44. person.setLabelFor(person1);
  45. remark.setLabelFor(remark1);
  46.  
  47.  
  48. JPanel p=new JPanel();
  49. p.setLayout(new GridLayout(15,0,0,0));
  50. p.add(visitorid);
  51. p.add(visitorid1);
  52. p.add(name);
  53. p.add(name1);
  54. p.add(fathername);
  55. p.add(fathername1);
  56. p.add(contact);
  57. p.add(contact1);
  58. p.add(address);
  59. p.add(address1);
  60. p.add(meetwhom);
  61. p.add(meetwhom1);
  62. p.add(purpose);
  63. p.add(purpose1);
  64. p.add(vehicle);
  65. p.add(vehicle1);
  66. p.add(person);
  67. p.add(person1);
  68. p.add(remark);
  69. p.add(remark1);
  70.  
  71.  
  72. JButton save=new JButton("Save");
  73. JButton refresh=new JButton("Refresh");
  74. JButton print=new JButton("Print");
  75.  
  76.  
  77. p.add(save);
  78. p.add(refresh);
  79. p.add(print);
  80.  
  81. JLabel msg=new JLabel("it is save and now print",JLabel.CENTER);
  82.  
  83.  
  84.  
  85.  
  86.  
  87. JFrame f = new JFrame();
  88. //f.addWindowListener(new BasicWindowMonitor());
  89. JRootPane root=f.getRootPane();
  90. root.setDefaultButton(save);
  91. Container content = f.getContentPane();
  92. content.setLayout(new BorderLayout(2,3));
  93. content.add(msg, BorderLayout.CENTER);
  94. content.add(p, BorderLayout.SOUTH);
  95. f.setSize(20,10);
  96. f.setContentPane(p);
  97. f.pack();
  98. f.setVisible(true);
  99. }
  100. }
Last edited by Tekmaven; Jun 8th, 2009 at 4:40 pm. Reason: Code Tags
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2,612
Reputation: adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of 
Solved Threads: 464
Moderator
adatapost's Avatar
adatapost adatapost is offline Offline
Posting Maven

Re: gatepass system

 
0
  #2
Jun 9th, 2009
Delegates the events and code to update your database.
Failure is not fatal, but failure to change might be. - John Wooden
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 40
Reputation: coolbuddy059 has a little shameless behaviour in the past 
Solved Threads: 0
coolbuddy059 coolbuddy059 is offline Offline
Light Poster

Re: gatepass system

 
0
  #3
Jun 10th, 2009
Can you suggest how I can proceed as I'm able to access the data using getText().But not able to save the data in database.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2,612
Reputation: adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of 
Solved Threads: 464
Moderator
adatapost's Avatar
adatapost adatapost is offline Offline
Posting Maven

Re: gatepass system

 
0
  #4
Jun 10th, 2009
Do you know how you use SQL API? Which database system are you using? (Oracle,MySql,Ms-Access).
Failure is not fatal, but failure to change might be. - John Wooden
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC