I use the following sentences to set icon for the figure of my Matlab GUI,
javaFrame = get(hObject,'JavaFrame');
javaFrame.setFigureIcon(javax.swing.ImageIcon('ntu.jpg'));
It runs, yet produces some warning message like "Warning: figure JavaFrame property will be obsoleted in a future release."
So how to set icon for my GUI figure to avoid this, I mean, be consistent with the most recent release of Matlab?
|
|
0
|
|
|
|
Reply
|
YIMING
|
1/10/2011 7:11:05 PM |
|
"YIMING" wrote in message <igflk9$jpl$1@fred.mathworks.com>...
> I use the following sentences to set icon for the figure of my Matlab GUI,
>
> javaFrame = get(hObject,'JavaFrame');
> javaFrame.setFigureIcon(javax.swing.ImageIcon('ntu.jpg'));
>
> It runs, yet produces some warning message like "Warning: figure JavaFrame property will be obsoleted in a future release."
>
> So how to set icon for my GUI figure to avoid this, I mean, be consistent with the most recent release of Matlab?
The one time I did this, I had to turn off the warning:
% Set the figure icon
warning('off','MATLAB:HandleGraphics:ObsoletedProperty:JavaFrame');
jframe=get(topfig,'javaframe');
jIcon=javax.swing.ImageIcon('triangle.JPG');
jframe.setFigureIcon(jIcon);
John
|
|
0
|
|
|
|
Reply
|
John
|
1/10/2011 7:29:05 PM
|
|