title: How to split a JButton (JAVA) text into multiple lines without knowing the line UNTIL CREATION
body: <p>How do you split a long line into multiple lines so it will fit in a button?</p>
  
  <p>Most other answers have used HTML but they hard code the string into the line making it impossible to split the line on the fly as the button is being created.</p>
  
  <p>Edited: I added a method to do this after researching, asking and not getting a good answer on how to do this dynamically.</p>
  
  <p>Please share your methods</p>