Actually, I don't believe button can detect how many click, simply because you can't double-click a button. You can however do a loop base, the first click, display one value, then next value, then next value.
You can also use addMouseListener() to get a MouseEvent for each click - this has a getClickCount() method which can be useful for detecting double clicks. As I recall you may need to look at the elapsed time between two clicks to decide if they're really "close enough" to count as a double click. There may well be a better way, but I don't know it.