How to turn off java error in matlab command window

5 次查看(过去 30 天)
I have build a Gui using guide as well as some java integration. Mainly a jtable using findjobj and Java Classes from Y. Altman. Snippet of table creation is below. When loading new data, I often get a java error like the following:
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 1 >= 1
at java.util.Vector.elementAt(Unknown Source)
at javax.swing.table.DefaultTableColumnModel.getColumn(Unknown Source)
What am I doing wrong in creating the jtable, as the error does not affect Matlab but is confusing to the people using the gui. Any way to supress it or get rid of it? Thanks a bunch. Ravi
Matlab Code:
%LOAD JAVA HANDLE, UITABLE NEEDS TO BE VISIBLE
set(handles.eis_data_table,'Visible','on')
jscroll = functions.java_table.findjobj(handles.eis_data_table,'persist');
jtable = jscroll.getViewport.getComponent(false);
%GET MATLAB TABLE DATA AND FORM INTO JAVA TABLE DATA
EIS_DATA_TABLE = get(handles.eis_data_table,'Data');
%SET DATA MODEL
jtable.setModel(javax.swing.table.DefaultTableModel(EIS_DATA_TABLE,
get(handles.eis_data_table,'ColumnName')));

回答(1 个)

Image Analyst
Image Analyst 2015-11-22
See attached function that I use to suppress some warnings. There are instructions in there to figure out how to find and suppress a new warning that you may have. But I don't think you can suppress an exception though, which is what you have.
  2 个评论
Ravi Goyal
Ravi Goyal 2015-11-23
Image Analyst, thanks. However, as you said it is a java exception I wish to turn off, or all java errors in general. General warnings I can see from your file and matlab help can be turned off.
Image Analyst
Image Analyst 2015-11-23
I suggest you call the Mathworks technical support to figure out why you're getting the Java error in the first place.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by