MaDKit forum

Welcome All !
Please, use explicit topic names when creating new threads. Thanks.

You are not logged in.

#1 2016-05-03 21:13:08

Registered: 2016-02-24
Posts: 10

Suppress Viewer Windows

This may seem a bit odd, but how would you hide the viewer JFrame that appears during simulations?

I am trying to consolidate all the windows into a single new JFrame, but the old JFrames still appear.

I have tried

launch(agent, false)


public void setupPanel{

I also need this solution to work for the watcher control and information JFrames, but I have not begun to investigate those just yet.



#2 2016-05-04 09:48:06

From: Montpellier
Registered: 2009-03-24
Posts: 172

Re: Suppress Viewer Windows


Maybe that you could take a look at the tutorial on GUI that explains the three ways of making an agent's GUI : 1. default, 2 custom, 3 independent : … index.html

Also, I guess that you are extending SwingViewer, which GUI is forced on start-up using createGUIOnStartUp() in its constructor, because there is no point in using the SwingViewer class otherwise as it extends the Watcher class for defining a default GUI for simulation (which does not mean that you cannot customize the SwingViewer'GUI as will, see the bees demo examples for instance).

So, my advice would be to either (1) create your own version of SwingViewer starting from its source code, (2) customize the SwingViewer frame like it is done in the bees demo or (3) start from scratch by extending Watcher and using the independent GUI method to use your own (which is probably what you want to do).


#3 2016-05-04 22:43:57

Registered: 2016-02-24
Posts: 10

Re: Suppress Viewer Windows

Ah thank you, thats exactly what I wanted


Board footer