Aligning Text in Center of JOptionPane
Hi,
I am trying to display messages using JOptionPane and a JDialog.
JOptionPane pane =new JOptionPane(message,
message_type,
option_type,
icon,
options,
initial_value){
publicint getMaxCharactersPerLineCount(){returndefault_characters_per_line;}
};
JDialog dialog = pane.createDialog(parent_component, title);
dialog.setVisible(true);
I want to be able to control the number of characters per line which I have found how to do, and to control the alignment of the text. I have not being able to work out how to control the alignment of the text. I would like to be able have the text centered so a long line followed by a short line is displayed nicely.
I have tried using <html><center>My Text</center></html>, however, 1stly the html tags are counted as character therefore shortening the 1st line and secondly is the message is over several line then the tag are broken up and not interpreted properly.
Any assistance greatly appreciated.
Leon

