File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes java swing star wars effect Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "java swing star wars effect" Watch "java swing star wars effect" New topic
Author

java swing star wars effect

paul beppe
Ranch Hand

Joined: Aug 09, 2012
Posts: 81
hi everybody..

i have create una animation of text...
this animation it's ok only with one string...i want create this effect with one file txt

this is my script...


this code read only last line of my document...why???
where is the error???
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39537
    
  27
It reads all lines, but it only stores the last one. You probably meant to write "text += s1" in line 51.


Ping & DNS - updated with new look and Ping home screen widget
paul beppe
Ranch Hand

Joined: Aug 09, 2012
Posts: 81
in this way goes all the text but all attacked him ... I would like to go out with \ n as the original text..

how to do???

help me please...
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39537
    
  27
Sorry, I don't understand what you're asking; can you rephrase it? What does the code do now, and what would you like it to do instead? TellTheDetails.
paul beppe
Ranch Hand

Joined: Aug 09, 2012
Posts: 81
ok! sorry for my language.....
how do I store all the rows respecting the "\ n"?


Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39537
    
  27
With the change I mentioned all lines will be stored. What do you mean by "respecting the \n"?
paul beppe
Ranch Hand

Joined: Aug 09, 2012
Posts: 81
one example

in my file is write:

1
beppe
paul
12
java
applet

whe run the program the letters out in this way:

1 beppe paul 12 java applet


thi is the problem....
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39537
    
  27
You mean when using drawString? It probably doesn't honor control characters. Why don't you keep the text in a List<String>, and iterate over that when drawing? You'd have to specify x and y coordinates for each line, but you will eventually have to do that anyway (as well as using different font sizes for different lines) if you want to achieve the Star Wars text effect.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: java swing star wars effect
 
Similar Threads
Scrollbar not working
Reading hyperlink in excel through Java
problem in getPosition and setPosition......
Balls are not moving
closing a jFileChooser window