943,891 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 675
  • Java RSS
Jun 8th, 2009
0

gatepass system

Expand Post »
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:=


java Syntax (Toggle Plain Text)
  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
Similar Threads
Reputation Points: 1
Solved Threads: 0
Light Poster
coolbuddy059 is offline Offline
45 posts
since Aug 2008
Jun 9th, 2009
0

Re: gatepass system

Delegates the events and code to update your database.
Moderator
Reputation Points: 2136
Solved Threads: 1228
Posting Genius
adatapost is offline Offline
6,527 posts
since Oct 2008
Jun 10th, 2009
0

Re: gatepass system

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.
Reputation Points: 1
Solved Threads: 0
Light Poster
coolbuddy059 is offline Offline
45 posts
since Aug 2008
Jun 10th, 2009
0

Re: gatepass system

Do you know how you use SQL API? Which database system are you using? (Oracle,MySql,Ms-Access).
Moderator
Reputation Points: 2136
Solved Threads: 1228
Posting Genius
adatapost is offline Offline
6,527 posts
since Oct 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: OLE in java
Next Thread in Java Forum Timeline: generating .html file using java





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC