calling java class from external jar

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

回答 (1 件)

Yair Altman
Yair Altman 2013 年 10 月 15 日
編集済み: Yair Altman 2013 年 10 月 15 日

0 投票

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
More on this in Section 1.7 of my Matlab-Java programming book.
Yair Altman

カテゴリ

ヘルプ センター および File ExchangeCall Java from MATLAB についてさらに検索

タグ

質問済み:

2013 年 10 月 11 日

編集済み:

2013 年 10 月 15 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by