Comments on: Matlab-Java interface using a static control https://undocumentedmatlab.com/articles/matlab-java-interface-using-static-control?utm_source=rss&utm_medium=rss&utm_campaign=matlab-java-interface-using-static-control Professional Matlab consulting, development and training Mon, 26 Sep 2016 10:44:13 +0000 hourly 1 https://wordpress.org/?v=6.7.2 By: Yair Altman https://undocumentedmatlab.com/articles/matlab-java-interface-using-static-control#comment-389260 Mon, 26 Sep 2016 10:44:13 +0000 http://undocumentedmatlab.com/?p=1917#comment-389260 In reply to Tom.

@Tom – you are correct. This was simply a typo (jButton instead of hButton). I corrected the main text accordingly.

]]>
By: Tom https://undocumentedmatlab.com/articles/matlab-java-interface-using-static-control#comment-389257 Mon, 26 Sep 2016 10:12:36 +0000 http://undocumentedmatlab.com/?p=1917#comment-389257 Why you getting a handle if you don´t use it?

% Assign a Matlab callback
hButton = handle(jButton, 'CallbackProperties');
set(jButton, 'ActionPerformedCallback', @myCallback);
]]>
By: Abdullah https://undocumentedmatlab.com/articles/matlab-java-interface-using-static-control#comment-346711 Sun, 15 Mar 2015 23:46:26 +0000 http://undocumentedmatlab.com/?p=1917#comment-346711 So, I am trying the following:

I added a listener to a Simulink block.

When trying to execute a public function of my JAR file within the listener, I get an error.

I tried to use a timer to see if that would solve the issue. However, it didn’t work.

Any clues?

]]>
By: Yair Altman https://undocumentedmatlab.com/articles/matlab-java-interface-using-static-control#comment-301312 Tue, 03 Dec 2013 16:53:15 +0000 http://undocumentedmatlab.com/?p=1917#comment-301312 In reply to Jai Naresh.

@Jai – take a look at JMI: http://undocumentedmatlab.com/blog/jmi-java-to-matlab-interface/

]]>
By: Jai Naresh https://undocumentedmatlab.com/articles/matlab-java-interface-using-static-control#comment-301304 Tue, 03 Dec 2013 16:42:40 +0000 http://undocumentedmatlab.com/?p=1917#comment-301304 Hi,
I am trying to launch matlab model and control its execution through Java Interface. Please let me know if their are any ways to do this.

Any response will help.

Thanks,
jai Naresh

]]>
By: Yair Altman https://undocumentedmatlab.com/articles/matlab-java-interface-using-static-control#comment-190276 Wed, 17 Apr 2013 10:01:03 +0000 http://undocumentedmatlab.com/?p=1917#comment-190276 In reply to nikhil.

@Nikhil – try adding C:\Users\x_shirod\.swt\lib\win32\x86_64\ to your librarypath.txt file:

edit('librarypath.txt')
]]>
By: nikhil https://undocumentedmatlab.com/articles/matlab-java-interface-using-static-control#comment-190269 Wed, 17 Apr 2013 09:45:40 +0000 http://undocumentedmatlab.com/?p=1917#comment-190269 Hello,

I am trying to open a UI created in Java SWT through Matlab.
But I am getting following error..

Java exception occurred:
java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
	no swt-win32-3833 in java.library.path
	no swt-win32 in java.library.path
	Native Library C:\Users\x_shirod\.swt\lib\win32\x86_64\swt-win32-3833.dll already loaded in another classloader
	Can't load library: C:\Users\x_shirod\.swt\lib\win32\x86_64\swt-win32.dll

Can any one help me in this…

thanking you in advance.


Nikhil

]]>
By: George Brennan https://undocumentedmatlab.com/articles/matlab-java-interface-using-static-control#comment-116934 Fri, 26 Oct 2012 17:00:30 +0000 http://undocumentedmatlab.com/?p=1917#comment-116934 Well done.

I would add that as you are passing the Matlab instantiated app object around couldn’t you change the hMap to public and access it without the file I/O?

Although getters/setters are probably a more acceptable route.

]]>
By: Yair Altman https://undocumentedmatlab.com/articles/matlab-java-interface-using-static-control#comment-112874 Thu, 04 Oct 2012 18:16:48 +0000 http://undocumentedmatlab.com/?p=1917#comment-112874 In reply to Rob Cranfill.

@Rob – thanks for the correction. I fixed the article accordingly.

]]>
By: Rob Cranfill https://undocumentedmatlab.com/articles/matlab-java-interface-using-static-control#comment-112871 Thu, 04 Oct 2012 15:21:43 +0000 http://undocumentedmatlab.com/?p=1917#comment-112871 I think there’s a typo in the original code – in the 2nd code block, the first one after the heading “Using a callback switchyard function”. It says

get(triggerButton, 'ActionPerformedCallback',@TriggerCallback);

but I’m pretty sure that should be

set(triggerButton, 'ActionPerformedCallback',@TriggerCallback);  % set, not get

At least, the first one doesn’t work for me, and the second one does. (I’m using Matlab 2012a, but I don’t think that’s the issue.)

Thanks for lots of great Matlab help!

/rob

]]>