How do I insert copyright Symbol inside JOptionPane.showMessageDialog?

168 Views Asked by At

I want to insert the copyright symbol instead of the word copyright.

JMenu m2 = new JMenu("Help");
    JMenuItem item3=new JMenuItem("About");
    item3.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            JOptionPane.showMessageDialog(null, "this application helps to convert numeric values to given conditions \n Author: Prashanna Nepal \n Copyright Prashanna",null,JOptionPane.PLAIN_MESSAGE);
        }});
3

There are 3 best solutions below

0
Jack On

You can just add it directly into your text:

JOptionPane.showMessageDialog(null, "... © Prashanna", null, JOptionPane.PLAIN_MESSAGE);

Since the symbol is not on your keyboard, one way is to copy-paste it from some source on the web (for example Wikipedia article https://en.wikipedia.org/wiki/Copyright_symbol). If you are on windows, you can also type it by holding alt-key and entering the keycode 0 1 6 9 on the keypad.

0
Ankit Sharma On

Just use the unicode.

"\u00a9"
String s = "this application helps to convert numeric values to given conditions \\n Author: Prashanna Nepal \\n"+ " \u00a9 " + "Prashanna";
JOptionPane.showMessageDialog(null, s,null, JOptionPane.PLAIN_MESSAGE);
0
Nitin Zadage On

Use unicode character \u00A9.

JOptionPane.showMessageDialog(null, "\u00A9 Prashanna", null, JOptionPane.PLAIN_MESSAGE);