Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Warning: Possible deprecated use of set on a Java object with an HG Property

Subject: Warning: Possible deprecated use of set on a Java object with an HG Property

From: Dennis B.

Date: 17 Nov, 2011 07:59:10

Message: 1 of 4

Hi Guys,

I got a Problem since Matlab Version 2011a:

Warning: Possible deprecated use of set on a Java object with an HG Property 'UserData'.
> In sc_gdlconfigdlggui>i_create_gcdconfig at 253
  In sc_gdlconfigdlggui at 50
  In sc_gdlconfigdlg at 69
  In sc_maindlggui>mdconfigcriteria_callback at 2664
  In sc_maindlggui at 135

The problematic command is: set(Table_ja, 'UserData', 'Rule_st');

Anyone an idea?

My Matlab-Version:
-------------------------------------------------------------------------------------
MATLAB Version 7.12.0.635 (R2011a)
MATLAB License Number: 490273
Operating System: Microsoft Windows XP Version 5.1 (Build 2600: Service Pack 3)
Java VM Version: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode
-------------------------------------------------------------------------------------

Subject: Warning: Possible deprecated use of set on a Java object with an HG Property

From: Steven_Lord

Date: 17 Nov, 2011 14:26:40

Message: 2 of 4



"Dennis B." <testhest@west.de> wrote in message
news:ja2ese$a4r$1@newscl01ah.mathworks.com...
> Hi Guys,
>
> I got a Problem since Matlab Version 2011a:
>
> Warning: Possible deprecated use of set on a Java object with an HG
> Property 'UserData'.
>> In sc_gdlconfigdlggui>i_create_gcdconfig at 253
> In sc_gdlconfigdlggui at 50
> In sc_gdlconfigdlg at 69
> In sc_maindlggui>mdconfigcriteria_callback at 2664
> In sc_maindlggui at 135
>
> The problematic command is: set(Table_ja, 'UserData', 'Rule_st');
>
> Anyone an idea?

http://www.mathworks.com/help/techdoc/rn/broifyr-1.html#brrxpv8-1

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: Warning: Possible deprecated use of set on a Java object with an HG Property

From: Yair Altman

Date: 17 Nov, 2011 15:27:30

Message: 3 of 4

"Dennis B." wrote in message <ja2ese$a4r$1@newscl01ah.mathworks.com>...
> Hi Guys,
>
> I got a Problem since Matlab Version 2011a:
>
> Warning: Possible deprecated use of set on a Java object with an HG Property 'UserData'.
> > In sc_gdlconfigdlggui>i_create_gcdconfig at 253
> In sc_gdlconfigdlggui at 50
> In sc_gdlconfigdlg at 69
> In sc_maindlggui>mdconfigcriteria_callback at 2664
> In sc_maindlggui at 135
>
> The problematic command is: set(Table_ja, 'UserData', 'Rule_st');
>
> Anyone an idea?
>
> My Matlab-Version:
> -------------------------------------------------------------------------------------
> MATLAB Version 7.12.0.635 (R2011a)
> MATLAB License Number: 490273
> Operating System: Microsoft Windows XP Version 5.1 (Build 2600: Service Pack 3)
> Java VM Version: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode
> -------------------------------------------------------------------------------------


Usually it is better to use the internal setter/getter methods of Java components. So, instead of:
    set(javaObj, 'Property',value)

You would use this:
   javaObj.setProperty(value)

However, since UserData is an internal Matlab object that does not have a corresponding setter/getter method, you can use this instead:

   setappdata(javaObj,'UserData',value);
   value = getappdata(javaObj,'UserData');

Yair Altman
http://UndocumentedMatlab.com

Subject: Warning: Possible deprecated use of set on a Java object with an HG Property

From: Dennis B.

Date: 23 Nov, 2011 12:52:08

Message: 4 of 4

> ...
> setappdata(javaObj,'UserData',value);
> value = getappdata(javaObj,'UserData');
>
> Yair Altman
> http://UndocumentedMatlab.com

Thx for your help and iam looking forward to your Matlab-Java Book :-)

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us