Java tutorial
import java.awt.BorderLayout; import javax.swing.JOptionPane; import javax.swing.JPanel; public class Main { public static void main(String[] args) { String pt1 = "<html><body width='"; String pt2 = "'><h1>Label Width</h1>" + "<p>Many Swing components support HTML 3.2 &" + " (simple) CSS. This is a new line.<br><br>" + "<p>The body width in this text is set to " + ""; String pt3 = " pixels." + ""; JPanel p = new JPanel(new BorderLayout()); int width = 175; String s = pt1 + width + pt2 + width + pt3; JOptionPane.showMessageDialog(null, s); } }