jcheckbox

How do I make a JPopupMenu appear when a JCheckBox is clicked?

I have a JCheckBox in a program (labeled "Use MiniTimer") that, when right-clicked, shows a JPopupMenu with options "Show on Close", "Show on Minimize", "Show on Close or Minimize", and "Do not use MiniTimer". How can I make this JPopupMnu appear below the JCheckBox when it is left-clicked, too? Note that I tried setting the actionPerf...

How do I write superscript word for checkbox text in java?

I made few checkboxes using swing in Java. I want to write a superscript text for the checkboxes but I'm not sure how. The code currently looks like this. JCheckBox hCheckBox = new JCheckBox("[M + H]+"); I want to have "+" sign inside the JCheckBox parameter superscripted. What's an easy way to do this? Thank you in advance. ...