AFAIK for platform independence you need to
test isPopupTrigger in
both mousePressed(...) and
mouseReleased(...). Not sure whether you require to test in
mouseClicked(...) too but it certainly doesn't do any harm to do so.
edit: Just checked this: on Linux, a context menu appears as soon as the right mouse button is pressed, unlike Windows where it appears when the right mouse button is pressed and then released.
Note that this behavior has nothing to do with Java; it's the normal OS behavior.