I'm in the process of making an application that keeps attendance. Once I have a list of students, how would I go about displaying them all and checking whether they are present or absent. I intially thought JTable would work, but it's not the easiest thing in the world to add swing components to a JTable. Is there an easier way to go about this? The image below shows roughly what I'm picturing, but if you have a different idea, feel free to share. Thanks!
Joel ChristophelJoel Christophel
1,80833 gold badges2020 silver badges4343 bronze badges
closed as not constructive by Wooble, Goran Jovic, stusmith, jlordo, Frank SheararJan 24 '13 at 16:26
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. If this question can be reworded to fit the rules in the help center, please edit the question.
3 Answers
Here is an EG to show how you can use
JTable
I have kept a boolean value for
ABS/Present coloumn, as suggested by @Hendrik Ebbers ,It will automatically come as a CheckBox .First you have to set the model of your JTabel using fooTable.setModel(dataModel) ,
Something like this:
Where in
new Object [][] i have my all Data, and new String [] will have the column names.
Rest you can find more info on
Try yourself,Ask for the source code if you have any problems.
UPDATE:
you can try out this:
joey rohanjoey rohan
2,26944 gold badges2121 silver badges5858 bronze badges
My suggestion is, use checkbox instead of two radio box controls .its look better .
And check the presented user .
Suresh AttaSuresh Atta
106k3030 gold badges151151 silver badges247247 bronze badges
AFAIK the first 3 columns look normal. But the fourth column is what I think you got stuck at.
Read about Renderer and Editor in
JTable .
I think rendering a
JPanel to the last column will do the trick. On that JPanel add two JRadioButton 's.
One example of doing it is shown here and here.
P.S: I tried this approach, it works.
Take Attendance System Java Code Free
Community♦
AmarnathAmarnath
6,71199 gold badges4444 silver badges7777 bronze badges
Not the answer you're looking for? Browse other questions tagged javaswingjdbcjradiobutton or ask your own question.
I need to get the system date, and Java provides the
new Date().getTime() .
But I need to avoid new object allocation (I'm working on a embedded system). How can I get the system time without allocating a new Lonely Neuron
Date object?
3,09433 gold badges1818 silver badges3535 bronze badges
michelemarconmichelemarcon
7,7441414 gold badges4545 silver badges6464 bronze badges
4 Answers
As jzd says, you can use
System.currentTimeMillis . If you need it in a Date object but don't want to create a newDate object, you can use Date.setTime to reuse an existing Date object. Personally I hate the fact that Date is mutable, but maybe it's useful to you in this particular case. Similarly, Calendar has a setTimeInMillis method.
If possible though, it would probably be better just to keep it as a Jon SkeetJon Skeet
long . If you only need a timestamp, effectively, then that would be the best approach.
1117k709709 gold badges81338133 silver badges85398539 bronze badges
jzdjzd
21.7k77 gold badges4949 silver badges7575 bronze badges
You can use
System.currentTimeMillis() .
At least in OpenJDK,
Date uses this under the covers.
The call in Mark ElliotMark Elliot
System is to a native JVM method, so we can't say for sure there's no allocation happening under the covers, though it seems unlikely here.
59.8k1515 gold badges126126 silver badges152152 bronze badges
Use System.currentTimeMillis() or System.nanoTime().
Pang
7,1011616 gold badges6868 silver badges107107 bronze badges
Aravind R. YarramAravind R. Yarram
62.6k3838 gold badges191191 silver badges276276 bronze badges
Not the answer you're looking for? Browse other questions tagged javadatememory-management or ask your own question.
Ok . So i have 100 student in one class and its too hard to call everyone by his name to take attendance so i searched for easy way to make attendance automatically and i found online script [javascript] for scan qr and display it content so i will generate a qr image for every student contains his id and i will make a sql table contains some thing like
so when the student scan his qr with the webcam i have . his id will go to mysql and record attended so i can extract it as Excel file
Ine ccie security v5 workbook. The instructor will alternate between presenting material and guiding viewers through hands-on, real-world exercises. Our CCIE Security Lab Exam course is 20+ hours of intensive, hands-on, instructor-led training.
this is qr scanner on githubhttp://miniqr.com/docs/demo/
will this be hard to this in php & mysql ?? please help me
epascarello
157k1414 gold badges143143 silver badges188188 bronze badges
Marwan AhmedMarwan Ahmed
1 Answer
Each QR code can be written as a url containing your php server and the id of the student.
Then on yourscript.php you simply extract the GET data and insert it into your database.
![]()
I would recommend having your attend table simple track the student IDs of who attended, you can go back later and figure out who was absent.
Proposed structure for attend:
paperpusherpaperpusher
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Not the answer you're looking for? Browse other questions tagged javascriptphpjquerymysql or ask your own question.Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |