a JAVA interface for a MAX patcher

Apr 18, 2007 at 5:19pm

a JAVA interface for a MAX patcher

Does anyone know if it’s possible to build a Java interface, interacting with a Max patcher?
I mean, I have a Max patcher, on which you can configure some values. I want to build a Java interface, so that the user can configure the patcher via the Java interface.
It involves that the Java interface can communicate with the Max patcher.

If anyone knows the solution, I’d be very thankful!

#31454

G
Apr 18, 2007 at 7:08pm

hi

i made this using the design utility for netbeans. i made the gui class a private class of my object, so it’s possible to call object methods from the gui class.
but i face a stability problem with java guis. sometimes, max freezes on gui instanciation…

G

#102356
Apr 18, 2007 at 7:36pm

Are you instantiating the gui instance from the UI thread using
something like SwingUtilities.invokeLater()?
This is also suggested by sun. Unfortunately the apple swing
implementation seems sensitive to this sort of thing…
especially given the fact that we are hosting a cocoa UI (swing) in a
carbon application (Max).
t

On Apr 18, 2007, at 12:08 PM, guillaume wrote:

>
> hi
>
> i made this using the design utility for netbeans. i made the gui
> class a private class of my object, so it’s possible to call object
> methods from the gui class.
> but i face a stability problem with java guis. sometimes, max
> freezes on gui instanciation…
>
> G

#102357

G
Apr 18, 2007 at 8:37pm

no in fact i’m instanciating the gui from the upper class (my maxobject). I’ll try to use the invokelater method.
also, when looking for a solution for my guis, i saw in the max java api a method called “nextWindowIsModal” (in MaxSystem i think), but i can’t really see what’s the aim of it.

g

#102358
Apr 18, 2007 at 9:24pm

It was a workaround for a bug in 10.3 OS X done with native code.
From the javadoc….

This is a workaround for a bug in swing on OSX jaguar. Swing dialogs
cause the
app to become stuck in a modal state. If you call this function
before showing the
showing dialog the app is able to recover properly.

t

On Apr 18, 2007, at 13:37 PM, guillaume wrote:

>
> no in fact i’m instanciating the gui from the upper class (my
> maxobject). I’ll try to use the invokelater method.
> also, when looking for a solution for my guis, i saw in the max
> java api a method called “nextWindowIsModal” (in MaxSystem i
> think), but i can’t really see what’s the aim of it.
>
> g

#102359
Apr 19, 2007 at 9:17am

Thank you very much. I feel what you say is what I need, but I have a problem : what is the GUI class?

#102360
Apr 19, 2007 at 9:21am

OK thank you, I understood what was the GUI class : Graphic User Interface. Thank you very much!

#102361
Apr 19, 2007 at 9:23am

Well, if I understand what you suggest, I have to write my UI class and to make it a Max object?

#102362
Apr 19, 2007 at 12:10pm

another way is, that you could build a seperated java (meaning a standalone, not initiated via mxj) application and send values etc over osc…works also quite good the other way round.

micha

#102363

G
Apr 19, 2007 at 1:37pm

bloodhy : you can declare your gui class as a private class of your maxobject.
example :

public class something extends MaxObject {

private int old = 0;

public something(){

}

public void loadbang(){

}

private class myGui extends JFrame{
// this code is generated by netbeans with matisse editor
// but you will have to add your interactions with the upper class.
}

}

G

#102364
Apr 30, 2007 at 3:49pm

Have you guys checked out processing.org? That’s a pretty cool package, and afaik, it can interface directly with Max (osc?). Probably worth a look for gui stuff.

J.

#102365

You must be logged in to reply to this topic.