This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Need to get data to appear in JTextField.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Need to get data to appear in JTextField.." Watch "Need to get data to appear in JTextField.." New topic
Author

Need to get data to appear in JTextField..

Freya Tan
Ranch Hand

Joined: Apr 14, 2004
Posts: 45
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..!
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

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.


GenRocket - A Test Data Generation Platform
Freya Tan
Ranch Hand

Joined: Apr 14, 2004
Posts: 45
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
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

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

Joined: Apr 14, 2004
Posts: 45
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need to get data to appear in JTextField..
 
Similar Threads
Problem displaying..
selected item from a JComboBox
I Seriously Need Helps.. Ugently
i need to know how to get data from textfile....
Unable to update my data.. why is that so..?