Posts

Showing posts with the label html

adding font styles to JOP in Java SE using basic html

Image
This is Not Big Deal,Only need few simple HTML knowledge, Sit back & watch 1)Normal message dialog with default font and color. the Code: JOptionPane.showConfirmDialog(rootPane,  "Do You want to Exit from Invoice? ", "Message", JOptionPane.YES_NO_OPTION); You see,message consists of just plain text(Boring...) 2) Changing the Text properties as I wish * first take the Sentence to show into a String Variable String txt=  "Do You want to Exit from Invoice? "; *Put HTML tags String txt=  "<html>Do You want to Exit from Invoice? </html>"; *Change the Properties (I want the "Invoice" word to be bolt,underlined,colored and set the whole sentence's font size to 4) String txt=  "<html><font size=4>Do You want to Exit from <font color= A7239C><b><u>Invoice</u></b></font> ? </font></html>"; the final Code: JOptionPane....