calling java class from external jar
    3 views (last 30 days)
  
       Show older comments
    
Hello, I have linked an external jar file and after imported a class, I am trying to call some methods belonging to it.
By using methodsview I see the different methods that I can use but some of them look quite strange and I am not able to access. In particular, from methosview I see that the enumerartors belonging to the class are defined using the symbol $
classname$enumtype
and I cant understand how I can access to them.
Any clue?
thanks Paolo
0 Comments
Answers (1)
  Yair Altman
      
 on 15 Oct 2013
        
      Edited: Yair Altman
      
 on 15 Oct 2013
  
      Here's one way to access Java enumerators:
msgType = javaMethod('valueOf','java.awt.TrayIcon$MessageType','INFO');
or:
enums = cell(javaMethod('values','java.awt.TrayIcon$MessageType'));
msgType = enums{3};  % 3=INFO
Yair Altman
0 Comments
See Also
Categories
				Find more on Call Java from MATLAB in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
