Java Programming: Making Credits

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CodeNoob117
    New Member
    • Jan 2013
    • 19

    Java Programming: Making Credits

    I want to make a scrolling credits screen that can be found at the end of most Games campaigns, or movies. How would I go about doing this in Java? Im thinking it would be some sort of rectangular text box that is redrawn several times to make a vertical scrolling movement, but I'm not sure how to proceed. Any ideas and advice on doing this is welcome.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    An animation example is provided here: http://docs.oracle.com/javase/tutori...ts/applet.html

    Comment

    • CodeNoob117
      New Member
      • Jan 2013
      • 19

      #3
      I found a way to mimic a credit scroll by using a class to extend JComponent. I used a file reader to put the lines of text in the file into a string array and then overrides the paint component to paint the text in the array. I used a parallel array of integers to track the x and y positions of the text and stopped drawing the text after its y was lower than a certain number. And had the component repaint itself after a timer counted down.

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Ok, be sure to put the File IO operations on their own thread rather than on the EDT.

        Comment

        Working...