JCheckBox special = new JCheckBox ("\nSpecial - $17.95" + "\nMeatball, Sausage, Mushroom, Onion, Pepperoni & Pepper");
In this line of code, how do you make the checkbox make the "..." into two lines?
JCheckBox special = new JCheckBox ("\nSpecial - $17.95" + "\nMeatball, Sausage, Mushroom, Onion, Pepperoni & Pepper");
In this line of code, how do you make the checkbox make the "..." into two lines?
The easiest way is to format it with HTML 3.2:
JCheckBox checkBox = new JCheckBox("<HTML>" + "Special - $17.95"
+ "<BR>"
+ "Meatball, Sausage, Mushroom, Onion, Pepperoni & Pepper"
+ "</HTML>");
The alternative is to set a custom ButtonUI, though that is a considerably more involved approach.