how can i do for "dialog jumps" i.e "First" show the first ten lines of dialogs,
first, what technologies are u using? Java2D or other? because the solution can give yoou completely different answers
for Java2D for example exists already API to support text management
but i f you are using UI component (Jtext etc...) is a completely different story.
Ok hire i will suppose that you are using JAva2D.
in this case you can find hire the official tutorial of the Oracle that show how to use the text in a Java2D graphic context
they are no more of 4-5 capiton very easy to undestandhttp://docs.oracle.com/javase/tutorial/2d/text/index.html
what you have to look is this captionhttp://docs.oracle.com/javase/tutorial/2d/text/drawmulstring.html
it will solve your problem to fix in you dialog box (drawing area) the text that you want to insert
after you need press enter to show more lines. :S How can i do that?
instead regarding the way to insert dialog box that evolve the internal text after return press, can be easy and there are 1000 solution, but each one of this solution will be incorrect if it is not easy adaptable to the framework that you implemented.
for example if u have the text in the file you can do like this
- 1-load the text that you want to print and transform in a array of chars
- 2-give this array as parameter to your dialog box
- 3-the dialog box contain an internal state that is the index where to start to use the character in the array, for example when it will start for the first time the index will be 0,
- 4-the dialog box print the x characted that are possible in concordance with its size and update the index
- 5-at each press enter continue the iteration 3 and 4 until the text is finish
but be carefull this solution has a problem for example its eat chatacters!!!!
immagin that you want to write this string in your dialog
"test string, i like write text in java" that is 38 chars
and your dialog write only 10 characters the result after any press return is
1 return "test strin"
2 return "g, i like w"
3 return "rite text i"
4 return "n java"
so take care to raffinate the algorithm to don't cut the words, for exaple you can use a StringTokenizer to reconize words