For keyboard input, I usually make a keyboard handler class that listens to keyboard events from my game component (usually a JComponent or a Canvas). When a key is pressed, I mark it as pressed in a boolean, when it is released, I unmark it.
I do much the same thing except that I use an enum to store the key state as either UNPRESSED, PRESSED, RELEASED_AND_UNPRESSED, or RELEASED_AND_PRESSED.
For some keys, I check whether they've been released, and for others I check whether they're currently pressed.
One thing to keep in mind is that you will not get key release events if your component doesn't have keyboard focus. This is a very common problem in many games, including "Big" titles. So I usually add a focus listener as well, and unset ALL keys when the focus is lost.
I "solved" this problem by only having one JFrame containing one JPanel with no other Swing components. I use my own custom widgets inside of the JPanel. That's a somewhat extreme solution, but there were other things I was trying to deal with as well.
An alternative would be to use JInput. I've tried it out for keyboard input, but it doesn't seem to be any particular improvement. I plan to use JInput for reading gamepad input, KeyListener for keyboard input, and MouseListener for mouse input. The KeyListener will be implemented as described above.
Edit: I should mention that my custom widgets don't work that way except for the main game widget For the other widgets, I just send the key event to the focused widget like Swing would do. I actually overrode the regular key input method for my main game widget to store the presses and releases. Since the main game widget is the only focusable widget visible while you're playing the game, I didn't need to worry about redirecting the input to other widgets within the main game widget.