title: Java SWT - Creating a new window from other class
body: <p>Today I wanted to create a simple Java SWT GUI Application using Eclipse, but for better clarity I wanted to have every sub-window in a different class. Since I am very new to Java Programming, is there a way to make a different class do its thing just by calling a method? I looked everywhere on the internet, but couldn't find what I was looking for...</p>
  
  <p>Here's what I have so far</p>
  
  <pre><code>Button foo = new Button(shell, SWT.PUSH);
  foo.setText("Edit");
  foo.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event e) {
          switch (e.type) {
              case SWT.Selection:
                  // Call the other Class file here
                  break;
          }
      }
  });
  </code></pre>