GUIs with Max

May 7, 2009 at 3:39pm

GUIs with Max

Hi all.

Do many people here create GUIs in Java, using Swing etc., for use with Max/MSP?

Is it possible to have a Java panel in a max patch, rather than a Frame floating around? Sort of like an Applet?

#43719
May 7, 2009 at 8:58pm

No, Java-based GUIs using Swing, etc.. must live in their own window.

Dan

#157002
May 8, 2009 at 11:27am

it’s possible by using the paint methods to draw to matrix objects..

#157003
May 8, 2009 at 1:36pm

Thanks for the replies all.

Matthew Aidekman wrote on Fri, 08 May 2009 05:27
it’s possible by using the paint methods to draw to matrix objects..

By that I presume you mean by outputting messages such as “line”, clear, etc. to the matrix object, as in some of the early Max tutorials. Except they sent the messages manually, rather than from java.

Or, can you obtain an external reference to the matrix object and can then use a paint method paint( Graphcis g ), wtih the g being the Graphics context of the external matrix object?

#157004
May 8, 2009 at 2:02pm

Quote:
Is it possible to have a Java panel in a max patch, rather than a Frame floating around? Sort of like an Applet?

Well, you can embed an applet in max actually :

– Pasted Max Patch, click to expand. –

and then talk to max via osc..
not really efficient I guess, but quite fun
Ch.

#157005
May 8, 2009 at 3:34pm

How are these patches encoded? It doesn’t look like uuencode.

I’d very much like to try the Applet example.

#157006
May 8, 2009 at 4:19pm

How to post patches to the forum :

http://www.cycling74.com/forums/index.php?t=msg&th=38828&start=0&rid=8548&S=aa5837c7f33a6bf9ecd607c371454860

The code I posted is just a [jweb], with a url pointing to an applet.

#157007
May 8, 2009 at 5:29pm

Don’t try this at home, boys and girls, if you’ve already loaded a JVM via the MXJ object. Oof! Ouch! Bang! Crunch! Argh!

Oh, and since you’re really in a web browser context here, the Java environment will be heavily sandboxed and probably can’t do OSC or much else.

#157008
May 8, 2009 at 7:13pm

I’ll be careful about the applet thing if a JVM is already loaded.

Applets that aren’t served across the web aren’t limited to the sandbox, and can read/write local disk etc. So OSC shouldn’t be a problem. On a local machine.

There might be a way around the floating Java window thing. If a Max patcher can find out its position on the screen, then a Java GUI (with or without decorations) could then follow it around. Even better if Max can detect when its patcher window is minimised, activated, etc. Are there Max objects to do this? If so, I’d like to try making

If Max can’t do it, Java itself might be able to do something. You could put a fixed image on the Max patch window. Java could then do a screengrab, find the picture, and move the window to the right location.

#157009

You must be logged in to reply to this topic.