Hi.. 1) i need help on retrieving my data from Textfile to display in JTextField my program goes like this: Firstly, user select "Date" from JList, "Month" & "Year" from the JComboBox and click a "Display App" button.. it would then appear whatever appointment info saved in TextFile in the JTextField.. and the problem is that i have trouble getting out the data & display in JTextField.. Can anyone help me..? Below is my Coding.. 2)i'm also having errors with my ArrayList.. not too sure what is missing, as i have declare it.. Can anyone point out to me..? This are the errors:
D:\Java Project\AppointmentPage.java:253: cannot resolve symbol symbol : class AppList location: class AppointmentPage AppList al = new AppList(); ^ D:\Java Project\AppointmentPage.java:253: cannot resolve symbol symbol : class AppList location: class AppointmentPage AppList al = new AppList(); ^ D:\Java Project\AppointmentPage.java:263: cannot resolve symbol symbol : variable get location: class java.util.ArrayList f = (FindDay)AppList.get ; ^ Thanks alot alot..!
In the second case AppList would have to be a class that you have defined somewhere and I don't see the code for AppList nor do I see a single method called getAppointments(); As far as...
Yeah, that won't work. There is no method in the ArrayList class defined as get. Best case it would be get() but ArrayList doesn't even have that method defined. Interesting how none of these issues are Swing related. These types of questions need to be asked in their appropriate forum like Java In General (Beginner) or Java In General (Intermediate). But I am not going to break apart your post for you since the first part of the question is Swing related. Helpful hint, from your other posts it looks like you are tackling too many issues in one setting. Get 1 thing to work, then move on to something else. Don't keep trying to make everything work at once. It also makes it easier for us to help you when we are dealing with a single issue at a time.
Originally posted by Freya Tan: Sorry, but it's seem like u did not reply me regarding my Topic on "Need to get data to appear in JTextField" .. (that's why i post the topic again in "I/O and Streams")
You keep asking that question, however, I have not seen a single bit of IO code in any of your questions. I am assuming that maybe the IO part of your code lies in a different class you aren't showing up. Maybe AppList? So in regards to your question of how to get data from a file to your textfield
Are you having a problem getting the "Some data"? If so, show us the code where you are trying to get the information from the text file.
Joined: Apr 14, 2004
Sorry, i'm not too sure if u know what exactly i'm doin.. but anyway, this is my code..
My Tokenizer file:
Let me explain how my program works.. 1) User has to select the Month & Year from the JComboBox, as well as the date from the JList and then click on the "Display App" button 2)this would however get the whatever data store under the date, month, year from textfile named("Appointment.txt") 3)and display in the 3 textfield (dayInput, timeInput & appInput) That's about it.. i'm not very sure if the way i did is correct ? Becos as u know i'm having problem with the ArrayList and the displaying of data.. but if u have a better way, pls correct me.. really would appreciate ur help.. Thanks
subject: Need to get data to appear in JTextField..