Guest User

Untitled

a guest
Apr 26th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. public class MainFrame extends JFrame {
  2.  
  3. private JPanel mainPanel;
  4.  
  5. public static void main(String[] args) {
  6. EventQueue.invokeLater(new Runnable() {
  7. public void run() {
  8. try {
  9. MainFrame frame = new MainFrame();
  10. frame.setVisible(true);
  11. } catch (Exception e) {
  12. e.printStackTrace();
  13. }
  14. }
  15. });
  16. }
  17.  
  18. public MainFrame() {
  19. initializeMainPanel();
  20. }
  21.  
  22. private void initializeMainPanel() {
  23.  
  24. exitLabel.addMouseListener(new MouseAdapter() {
  25. @Override
  26. public void mouseClicked(MouseEvent arg0) {
  27. throw new Exception("test");
  28. }
  29. });
  30. }
  31.  
  32. }
  33.  
  34. @Aspect
  35. public class AspectTest{
  36.  
  37. @AfterThrowing(pointcut = "execution(* com.test.MainFrame.*(..))", throwing = "ex")
  38. public void logError(Exception ex) throws Throwable {
  39. // ex.printStackTrace();
  40.  
  41. }
  42.  
  43. }
Add Comment
Please, Sign In to add comment