Re: Control formatting of strings split into multiple lines

Kevin Rahe <[email protected]> Mon, 6 Apr 2026 14:16:41 -0400
Newsgroups gmane.comp.java.ide.netbeans.user
Message-ID <[email protected]>
Thank you for the information. Unfortunately I'm unable to move beyond 
Java 8 at this time, at least for some of my projects. I was, however, 
able to solve my problem, though I can't say precisely how. When editing 
the source code for an older project that was configured with 
project-specific formatting, I noticed that the splitting of strings 
into multiple lines was working as I had desired. I couldn't, however, 
identify any differences between that project's formatting settings and 
the global settings I've been trying to use with other projects. By 
switching other projects between global and project-specific formatting 
settings, I was able to get them to also conform to the desired 
behavior. However, some other projects for which NetBeans had been 
behaving "badly," which have never had project-specific formatting 
settings, also began to behave "correctly." I of course have no 
explanation for that whatsoever. Perhaps some artifact of changing 
certain settings on certain projects has caused a change in NB's global 
behavior. The world may never know.

Kevin Rahe


On 3/31/2026 4:47 AM, Maciej Jaros wrote:
> Kevin Rahe (2026-03-30 17:19):
>> I've used NetBeans for developing Java applications for a couple 
>> decades now. In the code formatting options I had always configured 
>> the editor to format strings split by pressing Enter in the middle of 
>> them to put the plus-sign at the end of the original line and begin 
>> the continued line with a double-quote. However, with later versions 
>> of NetBeans (23, 25 and 28) I can no longer seem to find a setting 
>> that lets it format split strings this way. Instead, it puts the 
>> plus-sign at the beginning of the continued line. I have hundreds of 
>> thousands of lines of code formatted the "old" way and aim to keep 
>> any new code consistent with the existing code. However, this now 
>> takes a fair amount of manual fiddling every time I split a string. 
>> (I write a lot of embedded SQL code so I'm doing this a lot.) Is 
>> there any way to tease the newer versions of NetBeans into working 
>> the way I want them to? Or do I need to create a new feature request 
>> for this? Thank you.
>
> Might not be the answer you are looking for, and pardon me if this is 
> obvious, but if you can move to JDK 17 or later I would recommend 
> using JDK 14's """...""" multi-line strings. There's nothing better 
> for SQL strings, as you can very easily copy and paste from and to 
> pgAdmin / phpMyAdmin / SSMS.
> https://howtodoinjava.com/java14/java-text-blocks/
>
> Cheers,
> Maciej Nux
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
-- 
Kevin Rahe
KRAHE InfoSystems, Inc.
Walker, Michigan, USA
(616) 901-1730
[email protected]
www.KRAHE-IS.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists