using onAction method calls with indirectly-related objects

7 views
Skip to first unread message

Jason S

unread,
Jul 22, 2011, 12:00:56 PM7/22/11
to javabu...@googlegroups.com
I went to add menus today to one of my JPanels that is constructed using JavaBuilders, and the PDF guide recommends using Actions.

Except my class looks like this:

public class MyView
{
  final private JPanel panel = new JPanel();

  MyView(...)
  {
     ...
     SwingJavaBuilder.build(panel, yaml, resource);
  }
  public void onFoo() { ... }
}

So SwingJavaBuilder gets to do its magic on MyView.panel, but when it goes to find an action method onFoo(), it's looking in the wrong place.

Is there a way to tell it to build the GUI using MyView.panel but look for methods with MyView.this?

Jacek Furmankiewicz

unread,
Jul 23, 2011, 4:53:45 PM7/23/11
to javabu...@googlegroups.com
Nope. The underlying assumption always was that the object that builds itself contains all the methods that it refers to.


--
You received this message because you are subscribed to the Google Groups "JavaBuilders" group.
To view this discussion on the web visit https://groups.google.com/d/msg/javabuilders/-/JnJQJWt4G2UJ.
To post to this group, send email to javabu...@googlegroups.com.
To unsubscribe from this group, send email to javabuilders...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javabuilders?hl=en.

Reply all
Reply to author
Forward
0 new messages