Create a movie that has the text in a ticker tape moving diagonally from top left to bottom right.

What will be an ideal response?


```
/? ?
? Method t o c r e a t e a t i c k e r t a p e movie t h a t moves
? from t o p l e f t t o bottom r i g h t
? @param d i r e c t o r y t h e d i r e c t o r y t o w r i t e t o
? @param message t h e s t r i n g t o d i s p l a y
?/
public void makeTickerTapeMovieTopBot ( S t r i n g d i r e c t o r y ,
S t r i n g message )
{
int framesPerSec = 3 0 ;
P i c t u r e p = null ;
G r a p h i c s g = null ;
FrameSequencer f r a m e S e q u e n c e r =
new FrameSequencer ( d i r e c t o r y ) ;
Font f o n t = new Font ( ” A r i a l ” , Font .BOLD, 2 4 ) ;
// l o o p f o r 2 s e c o n d s o f a n i m a t i o n
f o r ( i n t i = 0 ; i < f r a m e s P e r S e c ? 2 ; i ++)
{
// draw t h e s t r i n g
p = new P i c t u r e ( 3 0 0 , 2 0 0 ) ;
g = p . getGraphics ( ) ;
g . s e t C o l o r ( C o l o r .BLACK) ;
g . setFont ( font ) ;
g . d r a w S t r i n g ( message , 1 0 + ( i ? 2 ) , 10 + ( i ? 2 ) ) ;
// add frame t o s e q u e n c e r
f r a m e S e q u e n c e r . addFrame ( p ) ;
}
// p l a y t h e movie
frameSequencer . play ( framesPerSec ) ;
}
```

Computer Science & Information Technology

You might also like to view...

Which of the following are true about two-dimensional arrays?

a) Two-dimensional integer arrays cannot be initialized via an initializer list. b) Two-dimensional arrays can only store up to 10 elements per array (or per row). c) Two-dimensional arrays are not accessible using for loops. d) Two-dimensional arrays cannot hold objects. e) None of the above is true.

Computer Science & Information Technology

JAXB’s static method ________ serialize objects as XML.

a. toXML b. serialize c. marshal d. None of the above

Computer Science & Information Technology

The java.util.Calendar and java.util.GregorianCalendar classes are introduced in Chapter 11 . Analyze the following code. Which of the following statements is correct?

``` 1 import java.util.*; 2 public class Test { 3 public static void main(String[] args) { 4 Calendar[] calendars = new Calendar[10]; 5 calendars[0] = new Calendar(); 6 calendars[1] = new GregorianCalendar(); 7 } 8 }``` a. The program has a compile error on Line 4 because java.util.Calendar is an abstract class. b. The program has a compile error on Line 5 because java.util.Calendar is an abstract class. c. The program has a compile error on Line 6 because Calendar[1] is not of a GregorianCalendar type. d. The program has no compile errors.

Computer Science & Information Technology

What type of malicious procedure involves using sniffing tools to capture network communications to intercept confidential information or gather credentials that can be used to extend the attack?

A. eavesdropping B. overflowing C. injecting D. capturing

Computer Science & Information Technology