Automatically scrolling text

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • spidermo
    New Member
    • Jun 2006
    • 2

    Automatically scrolling text

    I am looking to make text scroll from side to side. I would know how to do this if I were using a JPanel, but not with something like a JTextField. Any ideas?
  • D_C
    Contributor
    • Jun 2006
    • 293

    #2
    Can you keep rotating the contents of the string displayed?
    Code:
    string display = "Hello!   "; 
    while(marquee running) // code to rotate 
     display = display.substr(1) + display.substr(0,1);
    The code would cause it to change in this order, then continue to repeat.
    Code:
    "Hello!   "
    "ello!   H"
    "llo!   He"
    "lo!   Hel"
    "o!   Hell"
    "!   Hello"
    "   Hello!"
    "  Hello! "
    " Hello!  "

    Comment

    Working...