I'm not sure what I'm on, but I can't seem to get this right. I'm trying to reference a frame declared in one class from another class which is used exclusively to handle events.

In the first:
VB Code:
  1. import java.awt.*;
  2.  
  3. public class test {
  4.  
  5.     public Frame frmMain = new Frame("Test");
  6.  
  7.     public static void main(String args[]) {
  8.         test objTest = new test();
  9.     }
  10.  
  11.     public test() {
  12.         frmMain.addMouseListener(new mouseEvents());
  13.  
  14.         frmMain.setSize(100,100);
  15.         frmMain.setLocation(400,400);
  16.         frmMain.setVisible(true);
  17.     }
  18. }


In the second:
VB Code:
  1. import java.awt.event.*;
  2.  
  3. public class mouseEvents extends MouseAdapter {
  4.     public void mousePressed(MouseEvent e) {   
  5.         System.out.println(test.frmMain.getTitle());
  6.     }
  7. }

This is similar to what I'm trying to do. I get the "non-static variable frmMain cannot be referenced..." error on the println line.