in case you see something like this
then sure there is a problem, as you can see you are checking the instance and then you call an action method, this means that all these instances should implement a single interface which is the Command interface
this interface should be implemented by all the types mentioned in actionPerformed
now simply you can write actionPerformed like this
sure you can extend this pattern to do something more, for example maybe e.getSource() returns a list, you can simple loop over the list and call execute()
also you can add undo() function to the command interface and implement this function.