Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MainFrame extends JFrame {
- private JPanel mainPanel;
- public static void main(String[] args) {
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- try {
- MainFrame frame = new MainFrame();
- frame.setVisible(true);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- }
- public MainFrame() {
- initializeMainPanel();
- }
- private void initializeMainPanel() {
- exitLabel.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseClicked(MouseEvent arg0) {
- throw new Exception("test");
- }
- });
- }
- }
- @Aspect
- public class AspectTest{
- @AfterThrowing(pointcut = "execution(* com.test.MainFrame.*(..))", throwing = "ex")
- public void logError(Exception ex) throws Throwable {
- // ex.printStackTrace();
- }
- }
Add Comment
Please, Sign In to add comment