Ralph
Ralph

Reputation: 67

How to insert one line in Applet?

I would like to insert one line between "total charges"and "Thank you..."

Here is the code I have made so far:

JOptionPane.showMessageDialog(null, "Total Charges : RM" + dollar.format(totalCharges) + "Thank you please come again");

How can I do this? Thank You

Upvotes: 0

Views: 35

Answers (1)

Andrew Thompson
Andrew Thompson

Reputation: 168825

Use HTML formatting. Something like this should work:

JOptionPane.showMessageDialog(null, 
    "<html><body>Total Charges : RM" 
    + dollar.format(totalCharges) 
    + "<br>Thank you please come again");

Upvotes: 2

Related Questions