Deployed component GUIs and figures have different look and feel than MATLAB desktop
原文:http://www.mathworks.com/support/bugreports/1293244
Description
Deployed GUIs and figures look and feel different compared to undeployed MATLAB desktop versions.
Deployed applications are using the cross platform look and feel by default, while the undeployed figures and GUIs use the platform specific look and feel.
Workaround
To work around this issue, manually set the look and feel to the default platform specific version. If you're using workaround 2 or 3, depending on the platform you're deploying to, use one of the look and feel codes below and apply it with the workaround. This is not necessary if you're using workaround 1.
For Windows
com.sun.java.swing.plaf.windows.WindowsLookAndFeel
For Linux
com.jgoodies.looks.plastic.Plastic3DLookAndFeel
For Mac
com.apple.laf.AquaLookAndFeel
Workaround 1: Applied before deploying, on the MATLAB installation
This workaround is applied to the MATLAB installation on the development machine before packaging. Any subsequent deployment projects will pick up the change.
Download the startup.zip file attached below and unzip it to get the startup.m file. Place it in a directory that's on the MATLAB path, such as:
C:\Program Files\MATLAB\R2015b\toolbox\local
or
C:\Users\username\Documents\MATLAB
See the documentation on startup for more information.
If you already have a startup.m file, copy the contents of the below file and add it to the beginning of your startup.m file instead.
Workaround 2: Applied before deploying, on the MATLAB code to be deployed
This workaround is applied to the MATLAB code that is being deployed, before packaging. It only affects that particular deployment project.
To set the look and feel, add the following line with the appropriate look and feel name to your MATLAB file once prior to creating graphics or figures.
javax.swing.UIManager.setLookAndFeel('look_and_feel_code')
where look_and_feel_code is the platform specific look and feel code listed at the top.
If you're deploying platform-independent Java packages, Python modules or Production Server archives, use the ispc, isunix, or ismac MATLAB code to determine the platform and apply the correct look and feel.
The above Java code can fail if Java Swing is not loaded. Call usejava('swing') to check whether it is enabled or not.
Workaround 3: Applied after deploying
This workaround is for the target machine where the MATLAB runtime is installed and it can be applied after deployment. It requires no MATLAB code change and affects all deployed components that utilize the runtime.
Create a text file called java.opts (no .txt extension) with the following contents on one line:
-Dswing.defaultlaf=look_and_feel_code
where look_and_feel_code is the platform specific look and feel code listed at the top.
Place the java.opts file in the following directory of the MATLAB runtime installation:
mcrroot\bin\arch
where mcrroot is the MATLAB runtime installation location, and the arch is the runtime architecture. For example,
C:\Program Files\MATLAB\MATLAB runtime\v90\bin\win64
Alternatively, the java.opts file can also be placed in the startup directory of the deployed component if that directory is known.
Attachments
http://www.mathworks.com/support/bugreports/license/accept_license/6705?fname=startup.zip&geck_id=1293244
Deployed component GUIs and figures have different look and feel than MATLAB desktop的更多相关文章
- DotNet 资源大全中文版(Awesome最新版)
Awesome系列的.Net资源整理.awesome-dotnet是由quozd发起和维护.内容包括:编译器.压缩.应用框架.应用模板.加密.数据库.反编译.IDE.日志.风格指南等. 算法与数据结构 ...
- Matlab与.NET基于类型安全的接口混合编程入门
原文:[原创]Matlab与.NET基于类型安全的接口混合编程入门 如果这些文章对你有用,有帮助,期待更多开源组件介绍,请不要吝啬手中的鼠标. [原创分享]Matlab.NET混编调用Figure窗体 ...
- .net 调用 Matlab生成dll出现的问题(The type initializer for 'MathWorks.MATLAB.NET.Utility.MWMCR' threw an exception.)
https://cn.mathworks.com/matlabcentral/answers/278399-i-get-an-error-saying-the-type-initializer-for ...
- 【资源大全】.NET资源大全中文版(Awesome最新版)
算法与数据结构(Algorithms and Data structures) 应用程序接口(API) 应用程序框架(Application Frameworks) 模板引擎(Application ...
- React Virtual DOM Explained in Simple English
If you are using React or learning React, you must have heard of the term “Virtual DOM”. Now what is ...
- COM ,Threading Models,apartments,RPC
Component Object Model (COM) https://msdn.microsoft.com/en-us/library/windows/desktop/ms680573%28v=v ...
- 【转】Install MATLAB 2013a on CentOS 6.4 x64 with mode silent
首先要下载安装光盘. Matlab801_MacUnix.iso [root@db-172-16-3-150 mnt]# md5sum /ssd1/Matlab801_MacUnix.iso 0d3 ...
- matlab 图像设置
Matlab画图设置线宽和字号 既然这么多人来这里看过,我就多做点注释,方便大家参考. 下边这段代码不需要特别设置,只需要在plot语句之后插入即可. %plot your figure before ...
- 数字图像处理实验(14):PROJECT 06-01,Web-Safe Colors 标签: 图像处理MATLAB 2017-05-27 20:45 116人阅读
实验要求: Objective: To know what are Web-safe colors, how to generate the RGB components for a given jp ...
随机推荐
- 解决 ListView 水平滚动条不出现的问题(转载)
问题的原因:http://www.cnblogs.com/nankezhishi/archive/2010/03/17/wpfbug13.html 解决方法:http://www.cnblogs.co ...
- Linux安装oracle 10g常见问题之——OUI-25031
OUI-25031:Some of the configuration assistants failed/cancelled. 这是安装过程中常见的错误之一. 引起此错误的原因:/etc/hosts ...
- 【css】web标准
网页主要由三部分组成:结构(Structure).表现(Presentation)和行为(Behavior) 结构重点理解: XHTML 1.应用形式 ccs+div 2000 2.基于xml 和x ...
- 汽车之家, 比亚迪等成为开源数据库SSDB的用户
开源的 NoSQL 数据库 SSDB 已经一岁多了! 在这一年中, SSDB 不断被应用在众多业界知名互联网企业, 创业团队的产品中. 最近, 比亚迪汽车也成为 SSDB 的用户, 其将 SSDB 作 ...
- 微软职位内部推荐-Sr SDE-MOD-Beijing
微软近期Open的职位: JOB TITLE: Senior Software Design EngineerDEPARTMENT: Microsoft Office Division ChinaIM ...
- Qt智能指针简明说明
下面的智能指针分别对应boost库,Qt库,c++11的智能指针 boost::scoped_ptr QScopedPointer unique_ptr 在其生命期结束后会自动删除它所指的对象(确定 ...
- shell复习---文件解压命令
需要自己部署服务端,故在申请了空间之后,需要自己安装linux自己,自己安装Apache等,所以下载的压缩文件需要运行.网上找了一些解压命令不对,特别试了下面的方法有效,特别记录一下: 用ssh 登陆 ...
- HDU 3339 In Action 最短路+01背包
题目链接: 题目 In Action Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...
- BZOJ 1741: [Usaco2005 nov]Asteroids 穿越小行星群
Description 贝茜想驾驶她的飞船穿过危险的小行星群.小行星群是一个NxN的网格(1≤N≤500),在网格内有K个小行星(1≤K≤10000). 幸运地是贝茜有一个很强大的武器,一次可以消除所 ...
- PAT-乙级-1018. 锤子剪刀布 (20)
1018. 锤子剪刀布 (20) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue 大家应该都会玩“锤子剪刀布”的游 ...