Results 1 to 5 of 5
  1. #1
    winston is offline Member
    Join Date
    Oct 2011
    Posts
    2
    Rep Power
    0

    Exclamation How to make JTextField Displayer?

    Hello all,

    I would like to make a JTextField Displayer that dispays random String of text at random intervals , 2 mins apart and all string must be imported from a text file.

    any help?

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default Re: How to make JTextField Displayer?

    Quote Originally Posted by winston View Post
    Hello all,

    I would like to make a JTextField Displayer that dispays random String of text at random intervals , 2 mins apart and all string must be imported from a text file.

    any help?
    Sure, where specifically are you stuck? It sounds like you'll want to use a Swing Timer, so if you're not familiar with these, Google the Oracle tutorial on this. Otherwise please let us know if you have any specific questions that we can answer. Best of luck.

  3. #3
    winston is offline Member
    Join Date
    Oct 2011
    Posts
    2
    Rep Power
    0

    Default Re: How to make JTextField Displayer?

    Quote Originally Posted by Fubarable View Post
    Sure, where specifically are you stuck? It sounds like you'll want to use a Swing Timer, so if you're not familiar with these, Google the Oracle tutorial on this. Otherwise please let us know if you have any specific questions that we can answer. Best of luck.
    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?

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default 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

  5. #5
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,226
    Rep Power
    6

    Default Re: How to make JTextField Displayer?

    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...
    So what do you need help with???

    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

  1. Create Full Screen Graphic Displayer
    By kayve in forum New To Java
    Replies: 21
    Last Post: 09-16-2011, 09:33 PM
  2. Problems creating a bit displayer
    By cedron in forum New To Java
    Replies: 12
    Last Post: 06-10-2011, 09:38 AM
  3. Title not displayer
    By weezy2894 in forum Java Applets
    Replies: 13
    Last Post: 04-18-2011, 04:12 AM
  4. How to make Swing JTextField look like AWT TextField?
    By LeonLanford in forum AWT / Swing
    Replies: 1
    Last Post: 09-04-2010, 04:06 PM
  5. Replies: 7
    Last Post: 04-10-2010, 11:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •