Java Icon after packaging standalone application

조회 수: 3 (최근 30일)
Packy
Packy 2016년 10월 13일
편집: Yair Altman 2022년 10월 27일
Hi all!!! I'm trying to replace the default matlab icon in the top left corner of my gui; i've read that it is possible to choose it with the deploytool but i cannot reach my goal; after selecting the desired icon, the only thing that changes is the application icon (and not the one in the top left corner). I've tried with this code:
warning('off','MATLAB:HandleGraphics:ObsoletedProperty:JavaFrame');
javaFrame = get(hObject,'JavaFrame');
javaFrame.setFigureIcon(javax.swing.ImageIcon('ICONA.png'));
Running the code (as script) the change works great, but after packaging the standalone application appears the java icon in the top left corner.
Someone could help me?
Thank you very much for the attention!

답변 (2개)

Prasad Mendu
Prasad Mendu 2016년 10월 19일
편집: Prasad Mendu 2016년 10월 19일
Unfortunately, the ability to change that Java icon you are referring to into a custom one is not supported yet by MATLAB.
  댓글 수: 2
Packy
Packy 2016년 10월 19일
First of all thank you for your answer... Can you tell me why the code i used works properly (i can select a custom image for icon) when i run my application directly with matlab and it doesn't work after packaging the standalone application?
Cleber Gama
Cleber Gama 2019년 7월 11일
i am with this problem too. Did you solved this?

댓글을 달려면 로그인하십시오.


Yair Altman
Yair Altman 2022년 10월 27일
편집: Yair Altman 2022년 10월 27일
The icon image needs to be placed next to the executable when you run the program, otherwise it will not be found and the default Java icon is used. You can easily add this file in the "Files installed for your end users" section, at the bottom of the deploy-tool window, next to where the exe filename is displayed.
(for old Matlab releases with the old build tool, add it to the "shared resource and helper file" section of the Build tab, as shown here)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by