How to turn off java error in matlab command window
15 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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')));
0 comentarios
Respuestas (1)
Image Analyst
el 22 de Nov. de 2015
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 comentarios
Image Analyst
el 23 de Nov. de 2015
I suggest you call the Mathworks technical support to figure out why you're getting the Java error in the first place.
Ver también
Categorías
Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!