How to turn off java error in matlab command window

조회 수: 8 (최근 30일)
Ravi Goyal
Ravi Goyal 2015년 11월 22일
댓글: Image Analyst 2015년 11월 23일
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에서 Call Java from MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by