--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
public class MyWindow extends Window
{
public MyWindow() // <--- not clear where I need declare it
{
super("My Window!");
Panel horizontalPanel = new Panel(new Border.Invisible(), Panel.Orientation.HORIZONTAL);
Panel leftPanel = new Panel(new Border.Bevel(true), Panel.Orientation.VERTICAL);
Panel middlePanel = new Panel(new Border.Bevel(true), Panel.Orientation.VERTICAL);
Panel rightPanel = new Panel(new Border.Bevel(true), Panel.Orientation.VERTICAL);
horizontalPanel.addComponent(leftPanel);
horizontalPanel.addComponent(middlePanel);
horizontalPanel.addComponent(rightPanel);
addComponent(horizontalPanel); // <----this is a confusing part too
}
}
The defn wrapping the call to proxy basically is the constructor, so you wind up with something roughly like(defn get-window [](let [this (proxy [Window] ["My Window!"]; any methods you want to override on Window go here); stuff making panels goes here](.addComponent this horizontal-panel)this))Note, I'm calling a variable 'this' but it's *just a variable, the only reason I called it 'this' was to make it look more like the java version.
Yes, but that's for methods you're overriding and OP wants a constructor
--
Yes, but that's for methods you're overriding and OP wants a constructor