Skip to content

Instantly share code, notes, and snippets.

@SethTisue
Created February 21, 2012 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SethTisue/1878299 to your computer and use it in GitHub Desktop.
Save SethTisue/1878299 to your computer and use it in GitHub Desktop.
two NetLogo InterfaceComponents in one frame
import javax.swing.JFrame
import java.awt.FlowLayout
import org.nlogo.lite.InterfaceComponent
object Test extends App {
val path = "/Applications/NetLogo 5.0/models/Sample Models/"
java.awt.EventQueue.invokeAndWait(
new Runnable {
override def run() {
val frame = new JFrame
val comp1 = new InterfaceComponent(frame)
val comp2 = new InterfaceComponent(frame)
frame.setSize(1000, 800)
frame.setLayout(new FlowLayout)
frame.add(comp1)
frame.add(comp2)
frame.setVisible(true)
comp1.open(path + "Earth Science/Fire.nlogo")
comp2.open(path + "Biology/Slime.nlogo")
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment