try {
Class.forName(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\");
String connectionUrl = \"jdbc:sqlserver://\"+hostName.getText()+\";\" +
import javax.swing.*;
class FixedWidthLabel {
public static void main(String[] args) {
Runnable r = () -> {
String html = "Label Width
"
+ "Many Swing components support HTML 3.2 & "
+ "(simple) CSS. By setting a body width we can cause "
+ "the component to find the natural height needed to "
+ "display the component.
"
+ "
The body width in this text is set to %1s pixels.";
// change to alter the width
int w = 175;
JOptionPane.showMessageDialog(null, String.format(html, w, w));
};
SwingUtilities.invokeLater(r);
}
}