try {
Class.forName(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\");
String connectionUrl = \"jdbc:sqlserver://\"+hostName.getText()+\";\" +
You have to use \n
to break the string in different lines. Or you can:
Another way to accomplish this task is to subclass the JOptionPane class and override the getMaxCharactersPerLineCount so that it returns the number of characters that you want to represent as the maximum for one line of text.
→ http://ninopriore.com/2009/07/12/the-java-joptionpane-class/ (dead link, see archived copy).