Hi all
function deneme_deneme_OpeningFcn(hObject, eventdata, handles, varargin)
jFrame=get(handles.figure1,'javaframe');
jicon=javax.swing.ImageIcon('icon.gif');
jFrame.setFigureIcon(jicon);
handles.output = hObject;
guidata(hObject, handles);
-------------------------------------------------------------
showed icon.but I get an error command window.
-------------------------------------------------------------
Warning: figure JavaFrame property will be obsoleted in a future release. For more
information see the JavaFrame resource on the MathWorks Web site.
>
In deneme_deneme>deneme_deneme_OpeningFcn at 19
In gui_mainfcn at 221
In deneme_deneme at 15
In guidefunc>layoutActivate at 1140
In guidefunc at 14
--------------------------------------------------------------------
what is this ? but study, all the normal. (icon appears)
---------------------------------------------------------------------

 Respuesta aceptada

Walter Roberson
Walter Roberson el 12 de Mayo de 2011

2 votos

That is not an error, it is a warning about a planned change to an undocumented property. I believe that change did in fact go ahead.
You may wish to use Yair Altman's getjframe File Exchange contribution.

5 comentarios

nsbd
nsbd el 12 de Mayo de 2011
ty :)
Vineet Guru
Vineet Guru el 2 de Jun. de 2013
This solution works for a GUI. Does anyone have a solution for a Matlab Figure? (i.e. can the top-left logo of a Matlab figure be replaced with something else)?
Walter Roberson
Walter Roberson el 2 de Jun. de 2013
MATLAB figures are GUI's. Notice the code above is acting on handles.figure1 which is, by its name, a figure handle.
Lucademicus
Lucademicus el 10 de En. de 2019
Hi Walter, I just looked at Yair Altman's getjframe code. I think getjframe just disables the warning (see line 152).
Walter Roberson
Walter Roberson el 7 de Feb. de 2019
getjframe for handle fig does steps to get
fig.JavaFrame.fHG2Client.getWindow
which is a different output than just
fig.JavaFrame
For example it comes out as
com.mathworks.hg.peer.FigureFrameProxy$FigureFrame[fClientProxyFrame,30,220,1191x1190,layout=java.awt.BorderLayout,title=Figure 1,resizable,normal,defaultCloseOperation=DO_NOTHING_ON_CLOSE,rootPane=com.mathworks.widgets.desk.DTRootPane[,0,22,1191x1168,layout=com.mathworks.widgets.desk.DTRootPane$DTRootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=449,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]
I do not know what difference that makes.

Iniciar sesión para comentar.

Más respuestas (3)

Jan
Jan el 14 de Mayo de 2011

3 votos

No warning appears with this method:
jFrame=get(handle(handles.figure1), 'javaframe');
Gali Musa
Gali Musa el 7 de Feb. de 2019
Editada: Gali Musa el 7 de Feb. de 2019

0 votos

I'm still getting the warning after using

1 comentario

Walter Roberson
Walter Roberson el 7 de Feb. de 2019
Mathworks has not completely eliminated the JavaFrame property so it continues to warn. At some point, instead of warning it will just fail.
You are not intended to get the java frame yourself.

Iniciar sesión para comentar.

Allan III T. Condiman
Allan III T. Condiman el 22 de En. de 2020
Editada: Allan III T. Condiman el 22 de En. de 2020

0 votos

for me it's okay there's no getting error.

Categorías

Productos

Etiquetas

Preguntada:

el 12 de Mayo de 2011

Editada:

el 22 de En. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by