フィルターのクリア

How to change guide created GUI figure window title name?

17 ビュー (過去 30 日間)
John
John 2013 年 9 月 11 日
コメント済み: Henrik Froehlich 2016 年 4 月 28 日
Does anyone know a way to change the window title name on my guide created GUI figure? I created an application for my company and I was able to change the window figure icon using the following code:
javaFrame = get(hObject,'JavaFrame');
javaFrame.setFigureIcon(javax.swing.ImageIcon('RTI_Water_DB_Window_Icon.png'));
Now I would like to be able to also change the gui figure window title.
I tried:
javaFrame.setTitle('Water Quality Data Base'));
However this did not work with the following error:
No appropriate method, property, or field setTitle for class
com.mathworks.hg.peer.HG1FigurePeer.
Error in water_Quality_DB>water_Quality_DB_OpeningFcn (line
86)
javaFrame.setTitle('Water Quality Data Base');
Error in gui_mainfcn (line 221)
feval(gui_State.gui_OpeningFcn, gui_hFigure, [],
guidata(gui_hFigure), varargin{:});
Error in water_Quality_DB (line 42)
gui_mainfcn(gui_State, varargin{:});
I do not want to do a File > Save as in guide to rename the .m and .fig files because I specifically want the title to be 'Water Quality Data Base' and it is not possible to rename a file using a string with spaces. I do not want to use underscores.
Is there any way to accomplish what I want to do?
Thank you!

採用された回答

John
John 2013 年 9 月 11 日
I answered my own question, and the answer is simple. All you need to do is use guide and right click the background of your gui and edit the "Name" property.
This will change the window title name.
  2 件のコメント
Wenwu
Wenwu 2015 年 9 月 11 日
You answered my question. Did not expect it to be so simple. Is there any place that I could do this in the m file? Thanks
Henrik Froehlich
Henrik Froehlich 2016 年 4 月 28 日
thx a lot

サインインしてコメントする。

その他の回答 (4 件)

Pavan perali
Pavan perali 2015 年 2 月 20 日
You can do it using the code
set(handles.figure1, 'Name', 'New Name');

Ilyas
Ilyas 2014 年 12 月 12 日
Thank you. Was looking to change this too and found your answer.

Atul Parkhi
Atul Parkhi 2015 年 8 月 27 日
thanks!!

Ong Kian
Ong Kian 2016 年 4 月 4 日
Yes, set the name properties in figure is easy to handles this. Ty for answer

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by