1.
SwingUtilities.isRightMouseButton(e);
SwingUtilities.isLeftMouseButton(e);
2.
直接使用setLayout时是调用的JFrame的setLayout方法
调用this.getContentPane()后,使用的是Container的setLayout方法
jdk建议使用第二种,下面是原话:
By default the layout of this component may not be set, the layout of its contentPane should be set instead. For example: 
 thisComponent.getContentPane().setLayout(new GridLayout(1, 2))