Error 1172 trying to use mx.controls.List class

I am trying to write code in Action Script in Flex Builder 3
but I am having trouble using some of the classes in the mx
package. When I import like this:
import mx.managers.PopUpManager;
import mx.controls.List;
import flash.display.SimpleButton;
The SimpleButton imports just fine but for PopUpManager and
List, I get these errors:
1172: Definition mx.managers:PopUpManager could not be found.
1172: Definition mx.controls:List could not be found.
Other controls in the mx package seem to be available such as
mx.managers.IFocusManager (along with three other interfaces in
mx.managers.
Why is only part of the mx package available?

Hi,
I had a similar issue with the flash.desktop package. It
turned out I was running Flex Builder 3 Beta 2, not Flex Builder 3
Beta 3. I uninstalled Flex Builder, the Flex sdks & the Air
sdks & re-installed all the latest, that resolved the problem.
Hope this is some help.

Similar Messages

  • Errors when trying to use WebBrowser control

    Hi,
    I am trying to use the WebBrowser control on a winForm. When I do, I initially get a an error relating to the thread being required to be in a Single Threaded Apartment. (cannot be instantiated because the current thread is not in a single-threaded
    apartment) So I add it to a single threaded apartment which fixes that issue.
    However when I try to run it again, the next error I get is (Controls created on one thread cannot be parented to a control on a different thread). So I add the control to the form in the thread context of the form using a
    SyncContext, but this makes no difference so I use BeginInvoke. Not only does this not work but it freezes the form I am trying to load with the WebBrowser.Any
    Any ideas why this is acting in this fashion?
    Below is my final attempt at getting the web Browser to work:
    Many thanks for any suggestions!
    Public Sub New()
    Dim t As New Threading.Thread(AddressOf InitBrowser)
    t.SetApartmentState(Threading.ApartmentState.STA)
    t.Start()
    End Sub
    Private browser As WebBrowser
    Private Sub InitBrowser()
    browser = New WebBrowser()
    browser.Width = 500
    browser.Height = 500
    ' this didn't work
    '_syncContext.Send(Sub(x)
    ' Me.Controls.Add(browser)
    ' browser.Navigate("http://www.google.com")
    ' End Sub, Nothing)
    If Me.InvokeRequired Then
    Me.BeginInvoke(Sub()
    Me.Controls.Add(browser)
    browser.Navigate("http://www.google.com")
    End Sub)
    Else
    Me.Controls.Add(browser)
    browser.Navigate("http://www.google.com")
    End If
    End Sub
    @nt

    Hi Carl, Thanks for your time.
    Below is the initial simple, unthreaded code, but when I try to run it I get this error :-
    "ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment."
    Const TOP_MARGIN = 50
    Const SIDE_MARGIN = 3
    Me._browser = New WebBrowser() ' breaks here
    _browser.Top = TOP_MARGIN
    _browser.Left = SIDE_MARGIN
    _browser.Height = CInt(Me.Height - (TOP_MARGIN * 2))
    _browser.Width = CInt(Me.Width - (SIDE_MARGIN * 2))
    _browser.ScrollBarsEnabled = False
    so I wrap it in the STA thread which fixes that issue, as below:
    Dim browserThread = New Thread(Sub() InstantiateBrowser())
    browserThread.SetApartmentState(ApartmentState.STA)
    browserThread.Start()
    While browserThread.IsAlive
    Application.DoEvents()
    End While
    Me.Controls.Add(_browser) ' breaks here'
    _browser.Navigate(_preparationURL)
    End Sub
    Private Sub InstantiateBrowser()
    Const TOP_MARGIN = 50
    Const SIDE_MARGIN = 3
    Me._browser = New WebBrowser()
    _browser.Top = TOP_MARGIN
    _browser.Left = SIDE_MARGIN
    _browser.Height = CInt(Me.Height - (TOP_MARGIN * 2))
    _browser.Width = CInt(Me.Width - (SIDE_MARGIN * 2))
    _browser.ScrollBarsEnabled = False
    End Sub
    But now that is Apartment threaded, it is not being created on the same thread as the form, so when I try to add the browser to the forms controls collection I get the error below:
    "Controls created on one thread cannot be parented to a control on a different thread."
    I then tried rejoining the thread with a syncContext but that did not help. Any ideas on this?
    Many thanks
    @nt

  • I cannot uninstall or install itunes.  error is 'trying to use on a network resource that is unavailable'.  I cannot find a pth to any folders containning installation package itunes.msi.  Unable to download itunes since 2 updates ago and crashed com

    I cannot uninstall or install itunes.  error is 'trying to use on a network resource that is unavailable'.  I cannot find  path to any folders containing installation package itunes.msi.  Unable to download itunes since 2 updates ago and crashed computer.    Windows update as suggested in some posts does not assist either.
    Can anyone assist me?  Thank you so much

    Should the advice above not fix things for you...
    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down the page in case one of them applies.
    The further information area has direct links to the current and recent builds in case you have problems downloading, need to revert to an older version or want to try the iTunes for Windows (64-bit - for older video cards) release as a workaround for installation or performance issues, or compatibility with QuickTime or third party software.
    Your library should be unaffected by these steps but there are also links to backup and recovery advice should it be needed.
    tt2

  • Error while trying to use '{' in the query

    Hi,
    The below mentioned query is giving Error while trying to use '{'
    Query:
    select s,x from table(SEM_MATCH(
    '{?s rdf:type <http://www.cs.com/sbip/dwh/mdm/data_modeling#Base_Term> .
    ?s ?p ?x}',
    SEM_Models('foundation'),
    SEM_RuleBases('OWLPRIME'),
    SEM_ALIASES(SEM_ALIAS('dm','http://www.cs.com/sbip/dwh/mdm/data_modeling#'),
    SEM_ALIAS('owl','http://www.w3.org/2002/07/owl#')), null, 'INVALID'))
    where regexp_like(x,'Customers','i');
    Error details:
    ORA-29532: Java call terminated by uncaught Java exception: oracle.spatial.rdf.server.TokenMgrError: Lexical error at line 1, column 1. Encountered: "{" (123), after : ""
    ORA-06512: at "MDSYS.RDF_MATCH_IMPL_T", line 178
    ORA-06512: at "MDSYS.RDF_MATCH_IMPL_T", line 67
    ORA-06512: at line 4
    I am unable to use Option, Filter in query.
    Any solution?
    Please let me know do i need to apply any patch?
    Note: I am using Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    Regards,
    Kavitha.

    Hi,
    For OPTIONAL support in 11.1.0.7.0, you need the following patch
    Patch 7600122: CURLY BRACE SYNTAX,VIRTUAL MODELS, NETWORK INDEXES AND HINTO FRAMEWORK SUPPORT
    Support for SPARQL FILTERs in SEM_MATCH is not available for 11.1.0.7.0. You will need version 11.2.0.1.0 or later for FILTER support. With 11.2.0.1.0, we recommend that you apply our latest patch set:
    Patch 9819833: SEMANTIC TECHNOLOGIES 11G R2 FIX BUNDLE 2
    All of the above patches are available through My Oracle Support.
    Thanks,
    Matt

  • "500 internal server error" when trying to use F4 help in the variable sele

    Hi Experts,
    I am getting "500 internal server error" when trying to use F4 help in the variable selection screen (in WAD).
    How could this be resolved?
    Quick reply would be very helpfull.
    Thanks in advance !!

    It seems you are using wrong client ID. Make sure your logon pad has right details. You should verify this with your basis team.
    If the problem persists then try re-installing. But before you do that you can execute sapbexc.xla which is in the c:\program files\sap\bw. Type c:\ in cell c3 and click "start button". Any red flag means you have wrong version dll/ocx on your local drive, in that case you should reinstall with right patches.
    if this solution helps u then pls assign points

  • Runtime error when trying to use Thinkvantage system updater

    I get a runtime error when trying to use the Thinkvantage system updater.Have tried it numerous times and this is the exact message:
    "Runtime error!
    Program:C:\Program Files\Lenovo\System Update\tvsu.exe
    This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application's support team for more information."
    Can somebody please help me to get the Thinkvantage system updater working properly?
    Thanks-George
    This issue has since been resolved.Thanks-G

    I'm getting the same error.   I tried reinstalling system updater but it didn't help.

  • Why do I get this error when trying to use my bluetooth headset as a listening device? There was an error connecting to your audio device. Make sure it is turned on and in range. The audio portion of the program you were using may have to be restarted.

    Why do I get this error when trying to use my bluetooth headset as a listening device? There was an error connecting to your audio device. Make sure it is turned on and in range. The audio portion of the program you were using may have to be restarted.

    I may have already resolved this issue buy removing the device from my computer and re-pairing it. It is currently working just fine.

  • I get the following error when trying to use the itunes store "your apple id has been disabled"

    I get the following error when trying to use the itunes store "your apple id has been disabled".  My account was disabled when someone else had been using it without my knowledge.  I changed my apple id password and the apple id is still fine, but itunes has it disabled.  I verified that the computer is authorized for this apple id.  What to do now?

    Welcome to the Apple Community.
    Contact Apple through iTunes Store Support

  • When playing a home video DVD using DVD Player I tried to use the "Controls, Use current frame as jacket picture" facility to create a printable image but with no success. Can anybody point me in the right direction?

    When playing a home video DVD (created on my Panasonic DVD/Hard Disc recorder)  using the Mac DVD Player, I tried to use the "Controls, Use current frame as jacket picture" facility to create a printable image but with no success. I assume that any file created by this action would be stored somewhere in a common format but cannot find any such file. Can anybody point me in the right direction?

    Hi Sinious,
    Interesting to know about 10.8 and Flash. I'll hold off upgrading until they work together. Currently using 10.6.8 at home and same on the Universtity's computers.
    Haven't verified on Windows but shall do later in the week if I can get access to a Windows machine.
    Both the Flash player and the Projector come up not full screen, and if I leave it that way then things work OK as long as I don't make the video full screen (using the full screen button on the skin).
    However if I make the swf or projector full-screen (by using CMD-F or the menu option) then when I click on the menu item to take me to the page with the video on it, instead of a page with a smallish video and back button I get a black screen with no obvious controls. If I then press Escape I get my normal screen back and I am in the page that should have the video but there is not video and the back button does not work. So something wierd is going on here.
    If I make a file without any videos with a similar navigation structure everyting works ok except that when I go full screen I lose the finger cursor when I roll over my buttons (which is also wierd).

  • List of values failure error when trying to use dynamic data values

    Hi there,
    I have a user who is experiencing problems when trying to use dynamic values in a report.  Whenever he tries to insert dynamic parameters he gets the following error message:
    Prompting failed with the following message: 'List of Values failure: Failed to get values.  [Cause of error: Access is denied.]  Error Source: prompt.dll  Error Code: 0x8004380D
    He even opened the sample report - prompting.rpt - that is included with CR and gets the same error.
    We are using Crystal Reports XI Release 2 ver. 11.5.11.1470.
    Any help would be appreciated.

    Please excuse my ignorance of the product.  I've had this problem dropped in my lap and I know practically nothing about Crystal Reports.  In doing some digging it appears to me as if the BusinessObjects Enterprise software may not be installed properly, if at all.  In the programs menu under the BusinessObjects XI Release 2 folder I see a BusinessObjects Enterprise folder, but the only icon listed in that folder is Software Inventory Tool.
    Is the BusinessObjects Enterprise software a separate install from Crystal Reports or is it bundled together?  I talked with the tech that did the install and he said that all he had was the Crystal Reports install media.

  • Keep getting VncViewer.class not found error when trying to use Windows 7

    Greetings,
    I have no issue accessing the OVM Manager 2.2 with OEL 5.4 x86_64 with the latest Java release from ULN. But when I use a Windows 7 client ( x86) with the Sun Java 6 Update 18 I get the following error when trying to access the Console of a VM Guest:
    Java Plug-in 1.6.0_18
    Using JRE version 1.6.0_18-b07 Java HotSpot(TM) Client VM
    User home directory = C:\Users\deverej
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    load: class VncViewer.class not found.
    java.lang.ClassNotFoundException: VncViewer.class
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed:http://141.144.112.202:8888/OVS/faces/app/VncViewer/class.class
         at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 7 more
    Exception: java.lang.ClassNotFoundException: VncViewer.class
    I am curious fi I should use only a specifc Java Engine with IE 7 or the latest Firefox browers.

    Same issue to with Windows XP SP3 x86 with Java Runtime Enviornment 1.5.0_15
    J2SE Enviornment 5.0 Update 15
    Java 6 Update 17

  • Error 91 - Trying to Use the Variant to Data Function

    I am running into a problem when trying to use variants in my application. I have a state machine set-up in that one state creates a task list (cluster of arrays) and then converts it to variant. The variant is fed into a shift register that allows me to access the task list from a different state.
    The problem comes when I try to use the Variant to Data function. I right click on the task cluster to create a constant, and then wire that to the TYPE terminal of the Variant to Data Function. I wire the task cluster variant to the VARIANT terminal. When I run the VI, i get error 91: Possible reason(s): LabVIEW: The data type of the variant is not compatible with the data type wired to the type input.".
    How can I get this error when the type I wired to the TYPE terminal of the Variant to Data terminal is a constant created from the exact type created a variant from???
    Section of the state machine where I wire the cluster to variant:
    Section of the state machine where I use the Variant to Data to get the cluster out:
    The constant wired to the Variant to Data TYPE terminal was created from the cluster that is wired to the Data to Variant. I do not understand how there can be a type mismatch???
    Solved!
    Go to Solution.

    Charles_CLA wrote:
    crossrulz wrote:
    Are there any other state that run between these two?  I am noticing you have some "Use default if unwired" tunnels comming out of your case structure.  First of all, disable that on the tunnels.  Secondly, for those cases where you are not affecting that data, wire the data straight from the input tunnel to the output tunnel.  I recommend using the linked tunnels to make it even easier on yourself.
    With the default tunnels being output, your variant coming in could really be empty, therefore the conversion fails.
    Are you stalking me today?  Every single post I've clicked comment on, you beat me by a hair!
    No, just 12 hour days (due to the holiday) get really long...and you are just slow.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • P800 "Not Enough Memory" error when trying to use Contacts

    Now even after I reset my P800 from iSync I get this 'Not enough memory' error when I try to use my contact list.
    This is getting really frustrating! I want to downgrade...

    I suspect it's the feed as I've just tried it and the latest episode fails. Try contacting the Podcast's producer/publisher to let them know, since they may not. From your linked page, click on their name and follow that to their website, where you should find contact details.
    By the way, even if the problem is with iTunes, it's still down to the producer/publisher to rectify it, which is why I suggest you contact them
    Phil

  • OPM gives error when trying to use XSLT stylesheet

    Hi,
    I am trying use a simple XSLT stylesheet into an OPM project and see the result in the web determination screen.But when ever i am clicking on the link that is created when i compile the project with the XSL file, i am getting the error
    "An error occurred trying to process your request.
    This error has been logged and is available in the application logs.
    For support and assistance please contact [email protected]"
    I have kept the XSL file inside the "templates" folder in "include" folder.
    I am using a very simple one i.e
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0" >
    <xsl:output method="html"/>
    </xsl:stylesheet>
    How do I find what the error is and what do I need to do to solve this?
    Thanks and regards
    Sagnik

    Yes, now that above issue is solved and now when I click on the "HTML" or "PDF" link, I think some file is being generated but not properly.
    For HTML, I am getting blank page error and for PDF I am getting "file is damaged" error.May be, the xslt stylesheet that I am using is wrong, but I am absolutley stuck with this. I have tried many different formats of xlst stylesheets, but none seem to be working.
    pasting the two xslts below:
    *<?xml version="1.0" encoding="UTF-8" ?>*
    *<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">*
    *<xsl:output method="html"/>*
    *<xsl:template match="/">*
    *<xsl:apply-templates/>*
    *</xsl:template>*
    *<html>*
    *<body>*
    *<xsl:template match="session">*
    *<session><xsl:apply-templates/></session>*
    *</xsl:template>*
    *<xsl:template match="entity name">*
    *<entity-name align="center"><xsl:apply-templates/></entity-name>*
    *</xsl:template>*
    *<xsl:template match="instance label">*
    *<instance-label align="center"><xsl:apply-templates/></instance-label>*
    *</xsl:template>*
    *<xsl:template match="attribute id">*
    *<attribute-id><xsl:apply-templates/></attribute-id>*
    *</xsl:template>*
    *<xsl:template match="date-val">*
    *<date-val><xsl:apply-templates/></date-val>*
    *</xsl:template>*
    *<xsl:template match="text-val">*
    *<text-val><xsl:apply-templates/></text-val>*
    *</xsl:template>*
    *<xsl:template match="unknown-val">*
    *<unknown-val><xsl:apply-templates/></unknown-val>*
    *</html>*
    *</body>*
    *</xsl:template>*
    *</xsl:stylesheet>*
    and
    *<?xml version="1.0" encoding="UTF-8" ?>*
    *<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">*
    *<xsl:output method="html"/>*
    *<xsl:template match="/">*
    *<html>*
    *<body>*
    *<xsl:template match="session">*
    *<session><xsl:apply-templates/></session>*
    *</xsl:template>*
    *<enityName>*
    *<xsl:for-each select="entity name">*
    *<instancelabel>*
    *<xsl:for-each select="instance label">*
    *<attribute-id>*
    *<xsl:for-each select="attribute id">*
    *<text-val>*
    *<xsl:value-of select="text-val"/>*
    *</text-val>*
    *<date-val>*
    *<xsl:value-of select="date-val"/>*
    *</date-val>*
    *</xsl:for-each>*
    *</attribute-id>*
    *</xsl:for-each>*
    *</instancelabel>*
    *</xsl:for-each>*
    *</enityName>*
    *</body>*
    *</html>*
    *</xsl:template>*
    *</xsl:stylesheet>*
    also pasting the source xml file I am trying to convert.
    - <session xmlns="http://oracle.com/determinations/engine/relational/sessiondata/10.0" sessionDateTime="2010-12-17T11:34:08" locale="en-US" rulebase="Barclay_2910" rulebase-build="2010-12-17 06:04:02Z">
    - <entity name="global">
    - <instance label="global">
    - <attribute id="S_Other_Type_of_Business1">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Nature_of_Business">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="N_Desired_Review_Period">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_I_Confirm">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_new_investors_ID_Vd">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Address">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="N_Total_Amount_of_Capital_Invested">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_State_Business_use_Trading_name1">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Correspondence_Postcode">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Country">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_BTA_Code1">
    *<text-val>Central Government</text-val>*
    *</attribute>*
    - <attribute id="S_Correspondence_Address">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="N_Total_Amount_Capital_Invested_non_Corporate">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Business_Organisation">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_State_Business_use_Trading_name">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Business_Organisation1">
    *<text-val>1</text-val>*
    *</attribute>*
    - <attribute id="S_Date_Established1">
    *<date-val>2010-01-01</date-val>*
    *</attribute>*
    - <attribute id="S_Telephone_Number">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Date_of_Incorporation1">
    *<uncertain-val />*
    *</attribute>*
    - <attribute id="S_Date_of_Incorporation">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Postcode">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Start_Up_Type_Non_Corporate">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Previous_registered_names">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Other_Investments_non_corporate">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Registered_Number">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="b8@Properties_PropBkACC_xsrc">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Registered_Number1">
    *<text-val />*
    *</attribute>*
    - <attribute id="b6@Properties_PropBkACC_xsrc">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Business_use_Trading_name1">
    *<text-val>Yes</text-val>*
    *</attribute>*
    - <attribute id="S_Registered_address_Main_Trading">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_select_the_high_risk_industry_operated1">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Start_Up_Type">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Priority1">
    *<text-val>Standard</text-val>*
    *</attribute>*
    - <attribute id="S_Correspondence_address_same_Main_Trading">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Additional_Source_Capital">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Previous_Sort_Code">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Source_of_funds">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Choose_Start_Up1">
    *<text-val>Start Up/New Entity/Businesses</text-val>*
    *</attribute>*
    - <attribute id="S_Registered_Country">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Fax_Number">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Contributer">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_business_organisations_annual_turnover1">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Previous_Account_number_Roll_Number">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Previous_registered_names1">
    *<text-val />*
    *</attribute>*
    - <attribute id="b9@Rules_startuprule_doc">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_CIS_Record1">
    *<text-val>Yes</text-val>*
    *</attribute>*
    - <attribute id="S_Employees_Members1">
    *<text-val>1-9</text-val>*
    *</attribute>*
    - <attribute id="S_shareholders_Contributors">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Business_operate_high_risk_industry">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="b7@Properties_PropBkACC_xsrc">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_select_the_high_risk_industry_operated">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_business_organisations_annual_turnover">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Registered_Postcode">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Nature_of_Business1">
    *<text-val />*
    *</attribute>*
    - <attribute id="S_Country_of_Incorporation1">
    *<text-val>1</text-val>*
    *</attribute>*
    - <attribute id="N_issued_share_capital_company">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Correspondence_Country">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Type_of_Business1">
    *<text-val>Sole Trader</text-val>*
    *</attribute>*
    - <attribute id="S_Web_Address">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Registration_Number1">
    *<text-val />*
    *</attribute>*
    - <attribute id="S_Business_operate_high_risk_industry1">
    *<text-val>Yes</text-val>*
    *</attribute>*
    - <attribute id="S_Additional_Source_Capital1">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="Source_of_funds_non_Corporate">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Country_of_Incorporation">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_if_registered_address">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Date_Established">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Registration_Number">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_ID_VD">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_I_confirm_form_287">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Other_Investments">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_I_Confirm1">
    *<text-val>Yes</text-val>*
    *</attribute>*
    - <attribute id="S_Date_Form_Lodged">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Registered_Address">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Other_Type_of_Business">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="N_start_up_capital_business">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="N_Approx_transferring_balance">
    *<unknown-val />*
    *</attribute>*
    *</instance>*
    *</entity>*
    *</session>*
    Edited by: Sagnik on Dec 21, 2010 12:06 AM

  • Error when trying to use ImageIcon

    Hi,
    I am trying to use an ImageIcon to store an icon for plugins so that they can customize their menu and toolbar entries. I use a generic class, PaletteClass, to design all the plugins, and then extend PaletteClass to create individual plugins.
    PaletteClass:
    public class PaletteClass implements ItemListener{
          * PaletteClass
          * Superclass for the palettes in iKalk
          * @author Nathan Jarus
          * @version 0.1
         JFrame frame = new JFrame();//Window
         GridBagLayout layout = new GridBagLayout();
         GridBagConstraints constraints = new GridBagConstraints();
         JPanel main = new JPanel(layout);
         JToggleButton cmdTop = new JToggleButton("Stick to Top");
         //iKalk interface variables
         static String description = "Unnamed Plugin"; //Name of plugin
         ImageIcon icon = new ImageIcon();  //icon of plugin
         static boolean state = true; //is it visible?
         //static JToggleButton button = new JToggleButton(description, icon, state);
         static JToggleButton button;
         //static JToggleButton button = new JToggleButton(description, state);
         JCheckBoxMenuItem menu = new JCheckBoxMenuItem(description, icon, state);
         //boolean caret = false;//Used in determining when to clear the text box
         //boolean clear = false;
         //double tmp = 0;//Used in calculations
         //char op = ' ';//Used in calculations
         //Constructor
         PaletteClass(iKalk ikalk){
              setIcon("/images/generic.gif",ikalk,this);
              menu.addItemListener(this);
              //button.addItemListener(this);
              frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
              //frame.setLayout(new BorderLayout());
              try {
                   UIManager.setLookAndFeel(iKalk.getLF());
              } catch (UnsupportedLookAndFeelException e) {
                   JOptionPane.showMessageDialog(null,"How on earth did you get this message?  Check for a virus.  /n/nYour JRE has changed in the milliseconds that passed between the original loading of the program and this window loading!", "A message you should not be seeing", JOptionPane.ERROR_MESSAGE);
              constraints.fill = GridBagConstraints.BOTH;
              constraints.anchor = GridBagConstraints.CENTER;
              //Stick to Top button
              cmdTop.addItemListener(this);
              addComp(main, cmdTop, layout, constraints, 0, 0, 1, 1, 0, 100);
              //frame.add(main, BorderLayout.NORTH);
              //frame.setVisible(true);
              init();
              //updateGFX();
              //button = new JToggleButton(description, icon, state);
              //setIcon("/images/generic.gif",ikalk,this);
         public void init(){
              frame.setLayout(new BorderLayout());
              frame.add(main, BorderLayout.NORTH);
         //Item listener
         public void itemStateChanged(ItemEvent ie) {
              if(ie.getSource().equals(cmdTop)){
                   if (frame.isAlwaysOnTop()){
                        frame.setAlwaysOnTop(false);
                   else {
                        frame.setAlwaysOnTop(true);
              else if(ie.getSource().equals(button)){
                   if(button.isSelected()){
                        setVisible(true);
                   else{
                        setVisible(false);
              else if(ie.getSource().equals(menu)){
                   if(menu.isSelected()){
                        setVisible(true);
                   else{
                        setVisible(false);
         //Update the L&F
         public void updateGFX(){
              setVisible(false);
              SwingUtilities.updateComponentTreeUI(frame);
              SwingUtilities.updateComponentTreeUI(main);
              setVisible(true);
         //Decide whether or not the window is onscreen
         public boolean isShowing(){
              return frame.isVisible();
         public void setVisible(boolean v){
              frame.setVisible(v);
              state = isShowing();
         public void setVisible(){
              frame.setVisible(true);
              state = isShowing();
         /*Add a component to the gridbag layout
          *Args:
          *JPanel to                                   the JPanel to add the item to
          *Component what                         what to add
          *GridBagLayout layout                    the layout to add it to
          *GridBagConstraints constraints     the constraints to modify
          *int row                                   the row to add it to
          *int column                              the column to add it to
          *int numRows                              the number of rows the item crosses
          *int numCols                              the number of columns the item crosses
          *int weightX                              the x-weight of the item
          *int weightY                              the y-weight of the item
         public void addComp(JPanel to, Component what, GridBagLayout layout, GridBagConstraints constraints, int row, int column, int numRows, int numCols, int weightX, int weightY){
              //Set the constraint parameters
              constraints.gridx = column;
              constraints.gridy = row;
              constraints.gridwidth = numCols;
              constraints.gridheight = numRows;
              constraints.weightx = weightX;
              constraints.weighty = weightY;
              //Set these constraints in the layout
              layout.setConstraints(what, constraints);
              //Add the component
              to.add(what);
         public void setIcon(String path, iKalk ikalk, PaletteClass parent){
              parent.icon = new ImageIcon(ikalk.getClass().getResource(path));
    }This is one of the classes that I have trouble with:
    NumberPad:
    public class NumberPad extends PaletteClass implements ActionListener{
         //Set up the objects so that I can access them from another method
         public NumberPad(iKalk ikalk){
              super(ikalk);
    //Set the description
              description = "Number Pad";
              //setIcon("/images/NumberPad.gif", ikalk, this);
              button = new JToggleButton(description, icon, state);
    //Set up the frame
              try {
                   UIManager.setLookAndFeel(iKalk.getLF());
              } catch (UnsupportedLookAndFeelException e) {
                   //JOptionPane.showMessageDialog(null,"How on earth did you get this message?  Check for a virus.  /n/nYour JRE has changed in the milliseconds that passed between the original loading of the program and this window loading!", "A message you should not be seeing", JOptionPane.ERROR_MESSAGE);
              frame.setSize(155,160);
              frame.setLocation(500,500);
              frame.setTitle(description);
              updateGFX();
    //Set up the number entry pad
              JPanel panNumbers = new JPanel(new GridLayout(4,3));
              JButton cmd0 = new JButton("0");
              JButton cmd1 = new JButton("1");
              JButton cmd2 = new JButton("2");
              JButton cmd3 = new JButton("3");
              JButton cmd4 = new JButton("4");
              JButton cmd5 = new JButton("5");
              JButton cmd6 = new JButton("6");
              JButton cmd7 = new JButton("7");
              JButton cmd8 = new JButton("8");
              JButton cmd9 = new JButton("9");
              JButton cmdDec = new JButton(".");
              JButton cmdPM = new JButton("+/-");
              cmd0.addActionListener(this);
              cmd1.addActionListener(this);
              cmd2.addActionListener(this);
              cmd3.addActionListener(this);
              cmd4.addActionListener(this);
              cmd5.addActionListener(this);
              cmd6.addActionListener(this);
              cmd7.addActionListener(this);
              cmd8.addActionListener(this);
              cmd9.addActionListener(this);
              cmdDec.addActionListener(this);
              cmdPM.addActionListener(this);
              panNumbers.add(cmd7);
              panNumbers.add(cmd8);
              panNumbers.add(cmd9);
              panNumbers.add(cmd4);
              panNumbers.add(cmd5);
              panNumbers.add(cmd6);
              panNumbers.add(cmd1);
              panNumbers.add(cmd2);
              panNumbers.add(cmd3);
              panNumbers.add(cmd0);
              panNumbers.add(cmdDec);
              panNumbers.add(cmdPM);
              panNumbers.setVisible(true);
    //Final adding and init
              super.addComp(main, panNumbers, layout, constraints, 1, 0, 4, 1, 0, 0);
              //super.setVisible();
              setIcon("/images/NumberPad.gif", ikalk, this);
         public void actionPerformed(ActionEvent ae) {
              if(ae.getActionCommand().equals("1")){
                   Functions.addOne();
              else if(ae.getActionCommand().equals("2")){
                   Functions.addTwo();
              else if(ae.getActionCommand().equals("3")){
                   Functions.addThree();
              else if(ae.getActionCommand().equals("4")){
                   Functions.addFour();
              else if(ae.getActionCommand().equals("5")){
                   Functions.addFive();
              else if(ae.getActionCommand().equals("6")){
                   Functions.addSix();
              else if(ae.getActionCommand().equals("7")){
                   Functions.addSeven();
              else if(ae.getActionCommand().equals("8")){
                   Functions.addEight();
              else if(ae.getActionCommand().equals("9")){
                   Functions.addNine();
              else if(ae.getActionCommand().equals("0")){
                   Functions.addZero();
              else if(ae.getActionCommand().equals(".")){
                   Functions.addDec();
              else if(ae.getActionCommand().equals("+/-")){
                   Functions.PlusMins();
         /*public void init(){
         public void main(String [] args){
    }This is the code I use to load the plugins:
    void addPlugin(PaletteClass plugin){
              //pluginsVector.addElement(plugin);
              //plugin.setVisible();
              //toolMain.add(PaletteClass.button);
              pluginsVector.addElement(plugin);
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        toolMain.add(PaletteClass.button);
         }When I load this code, I get the following error (in Eclipse SDK):
    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at iKalk.loadPlugin(iKalk.java:587)
         at iKalk.loadPlugins(iKalk.java:578)
         at iKalk.<init>(iKalk.java:466)
         at iKalk$4.run(iKalk.java:563)
         at java.awt.event.InvocationEvent.dispatch(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.lang.NullPointerException
         at javax.swing.ImageIcon.<init>(Unknown Source)
         at PaletteClass.setIcon(PaletteClass.java:172)
         at NumberPad.<init>(NumberPad.java:82)
         ... 15 more
    If anyone knows what I am doing wrong, I'd like to know. I've tried several ways to fix it (as you can probably tell from the commented out code), but none of them worked.
    Sorry if my code isn't the cleanest; it's still in development =]
    PS: is it just me or does the code button in the post dialog still not work correctly?
    Thanks,
    LinuxMercedes

    Sorry for all the code. Here's a truncated version:
    PaletteClass:
    public class PaletteClass implements ItemListener{
         JFrame frame = new JFrame();//Window
         GridBagLayout layout = new GridBagLayout();
         GridBagConstraints constraints = new GridBagConstraints();
         JPanel main = new JPanel(layout);
         JToggleButton cmdTop = new JToggleButton("Stick to Top");
         static String description = "Unnamed Plugin"; //Name of plugin
         ImageIcon icon = new ImageIcon();  //icon of plugin
         static boolean state = true; //is it visible?
         static JToggleButton button;
         JCheckBoxMenuItem menu = new JCheckBoxMenuItem(description, icon, state);
         PaletteClass(iKalk ikalk){
              setIcon("/images/generic.gif",ikalk,this);
              init();
         public void init(){
              frame.setLayout(new BorderLayout());
              frame.add(main, BorderLayout.NORTH);
         public void setIcon(String path, iKalk ikalk, PaletteClass parent){
              parent.icon = new ImageIcon(ikalk.getClass().getResource(path));
    }NumberPad:
    public class NumberPad extends PaletteClass implements ActionListener{
         public NumberPad(iKalk ikalk){
              super(ikalk);
    //Set the description
              description = "Number Pad";
              button = new JToggleButton(description, icon, state);
              setIcon("/images/NumberPad.gif", ikalk, this);
    }Code I use to load Plugins:
    void addPlugin(PaletteClass plugin){
              pluginsVector.addElement(plugin);
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        toolMain.add(PaletteClass.button);
    }Oh yeah, and please don't go using this code in your projects without asking =]
    Thanks (and my apologies again),
    LinuxMercedes

Maybe you are looking for