Using java swing components in MATLAB
by Malcolm Lidierth
13 Jul 2007
(Updated 07 Apr 2009)
No BSD License
A custom class that eases the use of java.awt and javax.swing components in MATLAB
Download Now
|
Watch this File
|
| File Information |
| Description |
JCONTROL provides an easy way to integrate a full range of java GUIs from the java.awt and javax.swing libraries into MATLAB.
Example:
obj=JCONTROL(Parent, Style);
obj=JCONTROL(Parent, Style,...
PropertyName1, PropertyValue1,...
PropertyName2, ProeprtyValue2....);
Inputs:
Parent: the handle of a MATLAB figure or other container for the resulting component
Style: string describing a java component e.g. 'javax.swing.JPanel',
'javax.swing.JButton'
A JCONTROL object aggregates the MATLAB handle graphics container and the Java component (as returned by MATLAB's JAVACOMPONENT function) into a single object. Access to the JCONTROL's properties is provided by GET/SET calls. MATLAB dot notation may also be used. This notation also provides access to the java object's methods e.g.
pos=myobject.Position;
sz=myObject.getSize;
myobject.setEnabled(1);
myobject.setToolTipText('My tip');
myobject.setOpaque(1);
The class has been modified so that all jcontrol objects have a uipanel ancestor. This is to accommodate changes to the javacomponent.m function introduced in ML R2008b by TMW. The changes should be backwards compatible - tested with R2006a/R2008b. |
| Acknowledgements |
The author wishes to acknowledge the following in the creation of this submission:
UICOMPONENT - expands uicontrol to all Java classes
|
| MATLAB release |
MATLAB 7.4 (R2007a)
|
| Other requirements |
Platform independent. |
| Zip File Content |
|
| Other Files |
@jcontrol/ancestor.m, @jcontrol/close.m, @jcontrol/Contents.m, @jcontrol/delete.m, @jcontrol/get.m, @jcontrol/getappdata.m, @jcontrol/isappdata.m, @jcontrol/jcontrol.m, @jcontrol/private/VisibleProperty.m, @jcontrol/README.TXT, @jcontrol/rmappdata.m, @jcontrol/set.m, @jcontrol/setappdata.m, @jcontrol/subsasgn.m, @jcontrol/subsref.m, jcontrolDemo.m
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 21 Aug 2007 |
Fixes in subsref and setappdata.
Ancestor method added |
| 26 Sep 2007 |
Now accepts pre-constructed java objects as input to jcontrol constructor.
Subsref speed substantially improved |
| 21 Oct 2008 |
Modified for R2008b compatibility |
| 11 Nov 2008 |
Fix performance when uipanel given explicitly as parent (a further R2008b compatibility update) |
| 26 Nov 2008 |
Improved delete |
| 05 Dec 2008 |
Restore jControlDemo to zip |
| 07 Apr 2009 |
Background changes for compatability with R2009a javacomponent.m |
|
MATLAB Central Terms of Use
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Terms prior to use.
Contact us at files@mathworks.com