Skip to content
Advertisement

Tag: text

Why program did not show answer in out.txt?

The code should do a reverse and output the result to out.txt, but this does not happen, can you explain my mistake in the code. Thanks in advance Answer You are trying to reverse the string twice because of that the string is getting back to the original string. Also, there is an unnecessary (as per my understanding) while loop

Writing multiple lines using PrintWriter in Java

I am sorry if this question is already answered on the internet but by looking at the ‘similar questions’ I couldn’t find an answer for my problem. So basically I’m trying to understand why using PrintWriter to write lines of text into a file apparently skips the first line every 2 lines I give. This is the method I use

Java text wrap issue, caused by input width

I am trying to wrap text based on a width of 10 characters. After looking at other questions, I have the following: This works until a word in my string is longer than the specified width. When this occurs, the rest of the string is printed on line line instead of still following the line width rule. Any ideas? I

Using BufferedReader to read Text File

I’m having problems with using the BufferedReader I want to print the 6 lines of a text file: Now from what I can gather every time I call the readLine() method it automatically advances to the next line. So I can’t use the condition br.readLine() != null since it’ll already advance it one line and I get the output: What

Generate a image with custom text in Android

I’m trying to make an app for create custom cards. I’d like to add some text over a custom background (a jpg image). What is the best way of doing it? I’d need to show the user a preview of the card before send it to the server. Thanks Answer Use below code to achieve your requirement You have to

Advertisement