java - Scrolling Text with Transparent Background -
i used write tect ticker ,but unfortunately im weak on java , should make work on linux : need jlabel handles text , text should move news ticker ,it should scroll text inside jpanel end being jpanel bounds horizontally .
if had experience i`ll appreciate sharing me.
cheers
update : solved problem using example java translucent , next using vincent ramdhanie example animate .
here example of jpanel label uses simple thread scroll text. can modify suit needs.
public class scroller extends jpanel implements runnable{ jlabel label; string str = "the message scroll "; public scroller(){ super(); label = new jlabel(str); add(label); thread t = new thread(this); t.start(); } public void run(){ while(true){ char c = str.charat(0); string rest = str.substring(1); str = rest + c; label.settext(str); try{ thread.sleep(200); }catch(interruptedexception e){} } } }
so can place on jframe see in action. the string algorithm may not optimal works.
Comments
Post a Comment