I am writing a program that will stores information about students of two year groups. There are 10 pieces of information for each student and in total there is about 120 students. I have decided to have a separate .txt file for each student for the program to read and transfer each file information into array on start up.
However the problem I am facing is that there is a lot of different types of data manipulation: student profiles and JTable
for each grade. The student profile I think is very straight forward, but in the JTable
I will only need to access the first 2 and the last four pieces of information. I also need to have a JComboBox
that will have the name of each student and gets updated as well when new students are added.
My questions are as followed:
JLabel
in program run-time? (This information comes from the arrays of each student.) Oh and I am using NetBeans, if that makes any difference.
Needs urgent help. Thank you!
As follows
File folder = new File("D:/data");
File[] files = folder.listFiles();
Depending on the layout manager, to prevent on laying out the first window, and then having to short labels, maybe use a minimal size.
label.setText(...);
label.setMinimalSize(new Dimension(..., ...));
Yes, it might be simpler to use a database.
Your approach has some clarity but implies writing a lot of code for maintaining lists, and writing several files back, and maintaining data integrity. Coupled with swing GUI code that is an effort.
In every case make sure you make backups, and have test data and such. Separate Model (the data) from the View (GUI).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.