• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need to get data to appear in JTextField..

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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..!
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm confused. You have an ArrayList defined like

And then you have..

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.
 
Freya Tan
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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")
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Freya Tan
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
reply
    Bookmark Topic Watch Topic
  • New Topic