Results 1 to 5 of 5
- 10-12-2011, 02:35 PM #1
Member
- Join Date
- Oct 2011
- Posts
- 2
- Rep Power
- 0
-
Re: How to make JTextField Displayer?
- 10-13-2011, 08:10 AM #3
Member
- Join Date
- Oct 2011
- Posts
- 2
- Rep Power
- 0
Re: How to make JTextField Displayer?
Thank you for the aswer , im really new to the programming of java . I would like to know how to read from a txt file a line and display it in JTextField for about 2 minutes then read the second line of the txt and display it for 2 minutes ens. and the start from the begining again looping again and again...
Any help?
-
Re: How to make JTextField Displayer?
You will likely want to read the entire file into perhaps an ArrayList<String> or LinkedList<String>, and I would use the Scanner class to do this fairly easily: The Scanner Tutorial. Then you'd want to use a Swing Timer to loop through the list of Strings and display them in your JTextField: Swing Timer Tutorial
- 10-14-2011, 02:33 AM #5
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,158
- Rep Power
- 5
Re: How to make JTextField Displayer?
So what do you need help with???I would like to know how to read from a txt file a line and display it in JTextField for about 2 minutes then read the second line of the txt and display it for 2 minutes ens. and the start from the begining again looping again and again...
Do you know how to read text from a file?
Do you know how to store a line of text in Java?
Do you know how to store multiple lines of text?
Do you know how to create a JTextField?
Do you know how to change the text in the text field?
Do you know how to write a loop?
Do you know how to schedule an activity every 2 minutes?
Do you know how to use an if statement to determine if you are at the end so you can go back to the beginning?
State which step you are having problem with and post the code you have written and we can give suggestions. We can't write the program for you. First start by reading each line of text and then disply the line of text using System.out.println(). Then from there you save each line of text and create a loop to display the line. Do the code one step at a time.
Similar Threads
-
Create Full Screen Graphic Displayer
By kayve in forum New To JavaReplies: 21Last Post: 09-16-2011, 09:33 PM -
Problems creating a bit displayer
By cedron in forum New To JavaReplies: 12Last Post: 06-10-2011, 09:38 AM -
Title not displayer
By weezy2894 in forum Java AppletsReplies: 13Last Post: 04-18-2011, 04:12 AM -
How to make Swing JTextField look like AWT TextField?
By LeonLanford in forum AWT / SwingReplies: 1Last Post: 09-04-2010, 04:06 PM -
How to make JTextField input only allowed numbers ?
By BluXit in forum New To JavaReplies: 7Last Post: 04-10-2010, 11:31 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks