The Artima Developer Community
Sponsored Link

Java Answers Forum
Ticker

4 replies on 1 page. Most recent reply: Oct 31, 2003 7:05 AM by Matt Gerrans

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 4 replies on 1 page
Singh M.

Posts: 154
Nickname: ms
Registered: Mar, 2002

Ticker Posted: Oct 31, 2003 12:25 AM
Reply to this message Reply
Advertisement
Can anyone point me as to how do I go about writing an applet/application which displays the text such that it scrolls across the screen.

Will I need to use java 2d?

TIA


Rahul

Posts: 52
Nickname: wildhorse
Registered: Oct, 2002

Re: Ticker Posted: Oct 31, 2003 12:50 AM
Reply to this message Reply
If it is a simple applet, you can use
drawString(String msg, int x, int y)
method of Graphics class. x is the position of the first character of the message. x,y co-ordinates are with respect to the Graphics context in your applet. You can increment x in a loop to simulate scrolling text across your applet.

Joe Parks

Posts: 107
Nickname: joeparks
Registered: Aug, 2003

Re: Ticker Posted: Oct 31, 2003 3:59 AM
Reply to this message Reply
Ah. But how do you get the text to wrap when it hits the edge?

Answer: http://www.appletcollection.com/

Joe Parks

Posts: 107
Nickname: joeparks
Registered: Aug, 2003

Re: Ticker Posted: Oct 31, 2003 4:01 AM
Reply to this message Reply
Sorry. I posted too hastily. The applets on that page don't include the source.

Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: Ticker Posted: Oct 31, 2003 7:05 AM
Reply to this message Reply
Or you could just use the <marquee> HTML tag. I'm not sure if all browsers support it, though.

Flat View: This topic has 4 replies on 1 page
Topic: help needed Previous Topic   Next Topic Topic: using an index file to print out specific records

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use