Writing multiline JTextArea to txt file?

Use Utilities class public static final int getRowStart(JTextComponent c, int offs) public static final int getRowEnd(JTextComponent c, int offs) you pass offset and get offset of the row start and end.

(While I don't think this is an appropriate thing to do in this situation, that'd be a handy utility anyway, returning a collection of start/end pairs. ) – Dave Newton Oct 4 at 13:45.

I don't see how, except to just calculate word lengths using font metrics and do what the text area already does. What's the purpose behind this, though?

Well the program as a whole does a lot more than this, the JTextArea is just a field for the user to enter notes but I'd like the notes to look nicely formatted in the notepad file, because I don't like how long lines can be in notepad requiring you to scroll sideways before reading the entire line, Im hoping the user would probably make his notes using bullets or something so it would just be a short bit of text before user hits return but I cant be sure of that – Beef Oct 4 at 13:07 1 @Beef Notepad does word wrap too. The problem is when you add something like newlines, you're forcing your width: if they want it to be long in notepad, it'll be cut off to your text field's size. IMO you're better off storing as-is and letting the user decide.

– Dave Newton Oct 4 at 13:16.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions