Image load to a NetBeans 5.5 application using jdk6

i am using the following code to add an image to a system tray icon...
Image image = Toolkit.getDefaultToolkit().getImage("lightening.PNG");
trayIcon = new TrayIcon(image, "Tray Demo", popup);
now, since i am using NetBeans, it creates a jar file in the dist folder....and i am wondering, where i am supposed to place the image, so that it will show on the task bar...right now, the program runs fine, and i can even see the sub menu, but the image is not loaded......i tried the same code using just jcreator and one class file, and if i place the image in the same folder as the class file, the program run perfect and i can see the image, so i know it is not the code...but rather, where to place the image...i have tried everything...i think i have a copy of that image in every folder in the project folder
any help is apreciated, thank you very much
sam

problem sovled....thank you very much for you help....can you please explain to me what happenes when i add the directory to the runtime libraries....i am new to java, and NetBeans, but not new to OOP
thank you
sam

Similar Messages

  • Is it safe to develop applications using JDK6 update 10 Beta?

    Is it safe to develop applications using JDK6 update 10 Beta?
    Varuna

    JoachimSauer wrote:
    Generally, yes, you'd like to use a stable version to develop software with.
    But the Update 10 Beta contains no API changes whatsoever, so any software you develop using that JDK will just run fine on a stable JDK6 release.From what I've read it contains a couple of additions not present in previous updates/versions such as partly transparent/opaque Swing/AWT areas. Those new features
    definitely won't run on stable release versions.
    kind regards,
    Jos

  • Error while uploading images to SAP Mobile Documents from iPad application using ObjectiveCMIS.

    Hi,
    I am getting the error while uploading images to SAP Mobile Documents from custom iOS(iPad )application using ObjectiveCMIS library.
    My Custom method is as follows:
    - (void)createSalesOrderRouteMapImageInFolder:(NSString*)salesOrderRouteMapFolderId routeMapImageTitle:(NSString *)imageTitle routeMapContent:(NSData *)imageData
        NSInputStream *inputStream = [NSInputStream inputStreamWithData:imageData];
        NSMutableDictionary *properties = [NSMutableDictionary dictionary];
        [properties setObject:[NSString stringByAppendingFileExtension:imageTitle] forKey:@"cmis:name"];
        [properties setObject:@"cmis:document" forKey:@"cmis:objectTypeId"];
        [self.session createDocumentFromInputStream:inputStream
                                           mimeType:@"image/png"
                                         properties:properties
                                           inFolder:salesOrderRouteMapFolderId
                                      bytesExpected:[imageData length]
                                    completionBlock:^(NSString *objectId, NSError *error) {
                                        NSLog(@"Object id is %@",objectId);
                                        if(error == nil) {
                                            [inputStream close];
                                            NSLog(@"Uploading Sales order route map successfully.");
                                            [[NSNotificationCenter defaultCenter] postNotificationName:SaveOrderSuccessNotification object:nil];
                                        } else {
                                            [inputStream close];
                                            NSLog(@"Uploading sales order route map failed.");
                                            [[NSNotificationCenter defaultCenter] postNotificationName:SaveOrderFailedNotification object:error];
                                    } progressBlock:^(unsigned long long bytesUploaded, unsigned long long bytesTotal) {
                                        NSLog(@"uploading... (%llu/%llu)", bytesUploaded, bytesTotal);
    OBjectiveCMIS Method in which i am getting error during upload:
    - (void)sendAtomEntryXmlToLink:(NSString *)link
                 httpRequestMethod:(CMISHttpRequestMethod)httpRequestMethod
                        properties:(CMISProperties *)properties
                contentInputStream:(NSInputStream *)contentInputStream
                   contentMimeType:(NSString *)contentMimeType
                     bytesExpected:(unsigned long long)bytesExpected
                       cmisRequest:(CMISRequest*)request
                   completionBlock:(void (^)(CMISObjectData *objectData, NSError *error))completionBlock
                     progressBlock:(void (^)(unsigned long long bytesUploaded, unsigned long long bytesTotal))progressBlock
        // Validate param
        if (link == nil) {
            CMISLogError(@"Must provide link to send atom entry");
            if (completionBlock) {
                completionBlock(nil, [CMISErrors createCMISErrorWithCode:kCMISErrorCodeInvalidArgument detailedDescription:nil]);
            return;
        // generate start and end XML
        CMISAtomEntryWriter *writer = [[CMISAtomEntryWriter alloc] init];
        writer.cmisProperties = properties;
        writer.mimeType = contentMimeType;
        NSString *xmlStart = [writer xmlStartElement];
        NSString *xmlContentStart = [writer xmlContentStartElement];
        NSString *start = [NSString stringWithFormat:@"%@%@", xmlStart, xmlContentStart];
        NSData *startData = [NSMutableData dataWithData:[start dataUsingEncoding:NSUTF8StringEncoding]];
        NSString *xmlContentEnd = [writer xmlContentEndElement];
        NSString *xmlProperties = [writer xmlPropertiesElements];
        NSString *end = [NSString stringWithFormat:@"%@%@", xmlContentEnd, xmlProperties];
        NSData *endData = [end dataUsingEncoding:NSUTF8StringEncoding];
        // The underlying CMISHttpUploadRequest object generates the atom entry. The base64 encoded content is generated on
        // the fly to support very large files.
        [self.bindingSession.networkProvider invoke:[NSURL URLWithString:link]
                                         httpMethod:httpRequestMethod
                                            session:self.bindingSession
                                        inputStream:contentInputStream
                                            headers:[NSDictionary dictionaryWithObject:kCMISMediaTypeEntry forKey:@"Content-type"]
                                      bytesExpected:bytesExpected
                                        cmisRequest:request
                                          startData:startData
                                            endData:endData
                                  useBase64Encoding:YES
                                    completionBlock:^(CMISHttpResponse *response, NSError *error) {
                                        if (error) {
                                            CMISLogError(@"HTTP error when sending atom entry: %@", error.userInfo.description);
                                            if (completionBlock) {
                                                completionBlock(nil, error);
                                        } else if (response.statusCode == 200 || response.statusCode == 201 || response.statusCode == 204) {
                                            if (completionBlock) {
                                                NSError *parseError = nil;
                                                CMISAtomEntryParser *atomEntryParser = [[CMISAtomEntryParser alloc] initWithData:response.data];
                                                [atomEntryParser parseAndReturnError:&parseError];
                                                if (parseError == nil) {
                                                    completionBlock(atomEntryParser.objectData, nil);
                                                } else {
                                                    CMISLogError(@"Error while parsing response: %@", [parseError description]);
                                                    completionBlock(nil, [CMISErrors cmisError:parseError cmisErrorCode:kCMISErrorCodeRuntime]);
                                        } else {
                                            CMISLogError(@"Invalid http response status code when sending atom entry: %d", (int)response.statusCode);
                                            CMISLogError(@"Error content: %@", [[NSString alloc] initWithData:response.data encoding:NSUTF8StringEncoding]);
                                            if (completionBlock) {
                                                completionBlock(nil, [CMISErrors createCMISErrorWithCode:kCMISErrorCodeRuntime
                                                                                     detailedDescription:[NSString stringWithFormat:@"Failed to send atom entry: http status code %li", (long)response.statusCode]]);
                                      progressBlock:progressBlock];
    Attaching the logs:
    ERROR [CMISAtomPubBaseService sendAtomEntryXmlToLink:httpRequestMethod:properties:contentInputStream:contentMimeType:bytesExpected:cmisRequest:completionBlock:progressBlock:] HTTP error when sending atom entry: Error Domain=org.apache.chemistry.objectivecmis Code=260 "Runtime Error" UserInfo=0x156acfa0 {NSLocalizedDescription=Runtime Error, NSLocalizedFailureReason=ASJ.ejb.005044 (Failed in component: sap.com/com.sap.mcm.server.nw) Exception raised from invocation of public void com.sap.mcm.server.service.AbstractChangeLogService.updateChangeLog(java.lang.String,boolean) throws com.sap.mcm.server.api.exception.MCMException method on bean instance com.sap.mcm.server.nw.service.NwChangeLogService@4e7989f3 for bean sap.com/com.sap.mcm.server.nw*annotation|com.sap.mcm.server.nw.ejb.jar*annotation|NwChangeLogService in application sap.com/com.sap.mcm.server.nw.; nested exception is: javax.ejb.EJBTransactionRolledbackException: ASJ.ejb.005044 (Failed in component: sap.com/com.sap.mcm.server.nw) Exception raised from invocation of public com.sap.mcm.server.model.ChangeLog com.sap.mcm.server.dao.impl.ChangeLogDaoImpl.findByUserId(java.lang.String) method on bean instance com.sap.mcm.server.dao.impl.ChangeLogDaoImpl@2852b733 for bean sap.com/com.sap.mcm.server.nw*annotation|com.sap.mcm.server.nw.ejb.jar*annotation|ChangeLogDaoImpl in application sap.com/com.sap.mcm.server.nw.; nested exception is: javax.persistence.NonUniqueResultException: More than 1 objects of type ChangeLog found with userId=25f8928e-8ba0-4edd-b08e-43bf6fb78f1a; nested exception is: javax.ejb.EJBException: ASJ.ejb.005044 (Failed in component: sap.com/com.sap.mcm.server.nw) Exception raised from invocation of public com.sap.mcm.server.model.ChangeLog com.sap.mcm.server.dao.impl.ChangeLogDaoImpl.findByUserId(java.lang.String) method on bean instance com.sap.mcm.server.dao.impl.ChangeLogDaoImpl@2852b733 for bean sap.com/com.sap.mcm.server.nw*annotation|com.sap.mcm.server.nw.ejb.jar*annotation|ChangeLogDaoImpl in application sap.com/com.sap.mcm.server.nw.; nested exception is: javax.persistence.NonUniqueResultException: More than 1 objects of type ChangeLog found with userId=25f8928e-8ba0-4edd-b08e-43bf6fb78f1a}
    2015-03-12 04:08:31.634 Saudi Ceramics[4867:351095] Uploading sales order route map failed.

    Hi Sukalyan,
    Have you checked the below links?
    These will give you step by step implementation procedure.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a099a3bd-17ef-2b10-e6ac-9c1ea42af0e9?quicklink=index&overridelayout=true
    http://wiki.sdn.sap.com/wiki/display/WDJava/KmuploadusingWebdynproapplication
    Regards,
    Sandip

  • How can I load bitmaps/vector graphics in my application using only actionscript 3.0?

    I want to have DisplayObject that will randomly contain bitmaps/vectors from some database. I want to implement this using only code. How?

    use the loader class:
    var loader:Loader=new Loader();
    loader.load(new URLRequest("image1.jpg"));
    addChild(loader);  // or, yourdisplayobject.addChild(loader)

  • Problem with Image Loading

    Hi,
    I am using JWS to launch my application. Earlier I was using jdk1.5.0_12 version and everything was working fine. But, one of our machines didnt had jdk1.5.0_12 but had jdk1.5.0_19 version. So, JWS uses "Java Web Start 1.5.0_19" version.
    In my code, I am loading images at two different places. At first place I am loading my images using ClassLoader cl = Thread.currentThread().getContextClassLoader();
    InputStream baseInputStream = cl.getResourceAsStream(value);
              if(baseInputStream != null){
                  ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
                  byte[] buffer = new byte[1024];
                  int len;
                  while((len = baseInputStream.read(buffer)) >= 0)
                      out.write(buffer, 0, len);
                  baseInputStream.close();
                  out.close();
                  imageIcon = new ImageIcon(out.toByteArray());
              }This is working fine. But at the second place, I am setting the look and feel for my application using, SkinLookandFeel.loadDefaultThemePack() method. This method hangs permanently and my application fails to launch. When I debugged this method, I found the following:
    1. It goes to loadDefaultThemePack() method of SkinLookAndFeel class. (package: com.l2fprod.gui.plaf.skin)
    2. This in turn calls the loadThemePackDefinition((com.l2fprod.gui.plaf.skin.SkinLookAndFeel.class).getResource("/skinlf-themepack.xml")); of SkinLookAndFeel class.
    3. The XML file is loaded properly.
    4. In method loadThemePackDefinition(), the XML is parsed.
    5. This XML has a tag <icon name="InternalFrame.icon" value="icons/Window.gif" />.
    6. A URL is formed using URL iconURL = new URL(url, element.getProperty("VALUE"));7. This URL is also formed properly.
    8. Next, SkinUtils.loadImage(iconURL) is called.
    9. In this method, image is created using method: byte data[] = SkinLookAndFeel.getURLContent(url);
                img = Toolkit.getDefaultToolkit().createImage(data);10. The img variable created here has width and height = -1 with imagerep (consumer) as null, source (producer) as sun.awt.image.ByteAraryImageSource.
    11. Then, ImageUtils.transparent(img) method is called.
    12. In this method, toBufferedImage(image) method is clalled.
    13. in toBufferedImage(image) method, new image is created using image = (new ImageIcon(image)).getImage(); method.
    14. This new image created also has width and height = -1 with imagerep (consumer) as sun.awt.image.ImageRepresentation, source (producer) as ByteAraryImageSource.
    15. Now, new BufferedImage is created using BufferedImage bufferedImage = new BufferedImage(image.getWidth(null), image.getHeight(null), 2);16. In the constructor of BufferedImage, createCompatibleWritableRaster(width, height) method is called on DirectColorModel. This method throws exception, since width and height are -1.
    Points to note are:
    1. This is working fine with jdk1.5.0_12 but not with jdk1.5.0_19. I tried this with latest java 1.5 version, jdk1.5.0_21. The problem is still there.
    2. When I tried with jdk1.5.0_12, instead of DirectColorModel instance, createCompatibleWritableRaster() method in point 16 above was called on IndexColorModel. I am not creating or initializing any color model, so, I dont know, when does the instance of DirectColorModel or IndexColorModel is used and whether it has any thing to do with my problem.
    Can any one provide any pointers, what could be the issue with jdk1.5.0_19.

    Have a look throughout the forum (and google), JWS retrieved url syntax changed in 5u16 (or 14 I can never remember).
    Otherwise keep waiting for some good samaritan, good luck with it, most people are sick tired of this topic.
    Bye.

  • Problem with image loading in flex (with web dynpro ABAP integration)

    Hi,
    I am working with integration of flex and web dynpro abap. I am facing unusal problem while loading the images. I have the images in the MIME folder of web dynpro application. Since my swf file and all the images that I want to use are in the same folder(MIME), I am accessing them giving just the image name as source for the image in flex.
    By this method I get the images sometimes, but not everytime. So could anyone suggest me alternative method.
    Regards
    Prashant Chauhan
    Edited by: Prashant8809 on Jul 17, 2011 11:56 AM

    Hello Prashant,
    you need to mention the full path as source for the image in flex.
    ex. if your WD application name is Z_TEMP and image file name in mime folder is 'image.jpg' then you need mention the source in flex as
    http://servername:50001/sap/bc/webdynpro/sap/Z_TEMP/image.jpg
    Hope this solves your problem.
    BR, Saravanan

  • Issue with Image Loader in 14.0

    Hi All,
    In our application, we have a custom function module in ECC, which is passing the URL of an image uploaded on the content management server(KPRO). Custom FM calls 'SDOK_PHIO_GET_URL_FOR_GET' to get the URL of the image.
    When we execute the FM in ECC, we get the URL as:
    http://gbswidkprodb01.global.rexam.net:81/ContentServer/ContentServer.dll?get&pVersion=0046&contRep=YA&docId=001F296E9EB61ED3B6F490000438C20C&compId=TJ12A.jpg&accessMode=r&authId=CN%3DBC3,OU%3DI0520020335,OU%3DSAPWebAS,O%3DSAPTrustCommunity,C%3DDE&expirat
    when I use this URL in the browser the image gets loaded in browser.
    When I capture the output of JCO call in write file URL returned from FM is:
    http://<server>:81/ContentServer/ContentServer.dll?get&amp;pVersion=0046&amp;contRep=YA&amp;docId=001F296E9EB61ED3B6F490000438C20C&amp;compId=TJ12A.jpg&amp;accessMode=r&amp;authId=CN%3DBC3,OU%3DI0520020335,OU%3DSAPWebAS,O%3DSAPTrustCommunity,C%3DDE&amp;expiration=20140617181313&amp;secKey=MIIBUgYJKoZIhvcNAQcCoIIBQzCCAT8CAQExCzAJBgUrDgMCGgUAMAsGCSqGSIb3DQEHATGCAR4wggEaAgEBMG8wZDELMAkGA1UEBhMCREUxHDAaBgNVBAoTE1NBUCBUcnVzdCBDb21tdW5pdHkxEzARBgNVBAsTClNBUCBXZWIgQVMxFDASBgNVBAsTC0kwNTIwMDIwMzM1MQwwCgYDVQQDEwNCQzMCByASCCcTUiEwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTE0MDYxNzE2MTMxM1owIwYJKoZIhvcNAQkEMRYEFM%2FKd4MzWL0y1KfF58AHNg9PYqOlMAkGByqGSM44BAMELzAtAhUAtqASnXbD3E2ZM8EhG%2FLxgJhKCs0CFH0qFlBxzWlzS8kjeFw3kad63SHW
    when I use this URL in the browser I get 'HTTP 400' error.
    Using either of the two URL's in the image loader I get the error:
    [WARN] [ImageLoader_0]ImageLoader_0 Status: 400 - (bad request)
    We are currently on SAP MII 14.0 SP05(patch 3).
    Thanks in advance for your help.
    Regards,
    Darshan

    Sam,
    I tried logging in to ECC with the same user as the one that is making the Jco connection and it is giving the same URL which i was getting earlier when i was executing the FM with my user id. I am testing the FM through SE37.
    There is no logic in the custom BAPI to replace the <server> keyword. Based on the image name, it gives the URL of where the image is stored on the KPRO server.
    Could not find URL Decode function in the MII link editor, i believe it is the decode function which you are referring to. Even that is not working. If it is something other than this, do let me know.
    PS: This works fine in the 11.5 system from which we have upgraded to 14.0.
    regards,
    darshan

  • Something in correct with Image loading....

    Hi All,
    I have created a very simple form to load image into a form.
    Using forms 10g dev suite on win XP.
    I load two images for two image items.
    for IMAGE1 I have written the below code in its when-image-pressed trigger and this Image loading WORKS FILE...
    i get the desired image loaded
    DECLARE
         tiff_image_dir VARCHAR2(80) := 'C:\DevSuiteHome_1\forms\111.gif';
         photo_filename VARCHAR2(80);
    BEGIN
         :System.Message_Level := '25';
         photo_filename := tiff_image_dir ;
         READ_IMAGE_FILE(photo_filename, 'GIF', 'emp.my_test_button');
         READ_IMAGE_FILE(photo_filename, 'GIF', 'emp.my_test_button');
         IF NOT FORM_SUCCESS THEN MESSAGE('This employee does not have a photo on file.');END IF;
         :SYSTEM.MESSAGE_LEVEL := '0';
         END;
    the problem is with Image two...it laods some incorrect image .....as i am trying to USE JAR file
    the trigger code is below
    DECLARE
         photo_filename VARCHAR2(80);
    BEGIN
         :System.Message_Level := '25';
         READ_IMAGE_FILE('111.gif', 'URL', 'emp.image_item');
         IF NOT FORM_SUCCESS THEN MESSAGE('This employee does not have a photo on file.');END IF;
         :SYSTEM.MESSAGE_LEVEL := '0';
    END;
    below is the entry for my formsweb.cfg
    I have placed my
    [my_app]
    width=675
    height=480
    separateFrame=false
    splashScreen=no
    lookAndFeel=oracle
    colorScheme=blue
    background=/forms/formsdemo/images/blue.gif
    logo=/forms/formsdemo/images/bannerlogo.gif
    baseHTMLjinitiator=demobasejini.html
    baseHTMLjpi=demobase.htm
    baseHTML=demobase.html
    baseHTMLie=demobaseie.html
    envFile=formsdemo.env
    archive_jini=frmall_jinit.jar,AppIcons.jar
    #archive=frmall_jinit.jar
    pageTitle=Oracle Forms - My Application
    form=my_test_button.fmx
    imagebase=codebase
    userid=scott1/tiger@ora11g
    My classpath entry in ENV file is
    CLASSPATH=C:\DevSuiteHome_1\jlib\debugger.jar;C:\DevSuiteHome_1\forms\demos\my_app\AppIcons.jar;C:\DevSuiteHome_1\forms\demos\jars\uploadserver.jar;C:\DevSuiteHome_1\forms\demos\jars\demowebserviceclientside.jar;C:\DevSuiteHome_1\jdk\jre\lib\rt.jar;C:\DevSuiteHome_1\forms\demos\jars\javamailintegration.jar;C:\DevSuiteHome_1\forms\demos\jars\mail.jar;C:\DevSuiteHome_1\forms\demos\jars\activation.jar
    What mistake am i doing?
    rgds,
    s

    Slava ,Magoo and S@r@h....
    I have done the following,still no respite..
    step 1) Create the jar file
    C:\myapp>jar cvf AppIcons.jar *.gif
    added manifest
    adding: 111.GIF(in = 28895) (out= 28675)(deflated 0%)
    adding: 222.GIF(in = 28895) (out= 28675)(deflated 0%)
    adding: name_gif.GIF(in = 28903) (out= 28681)(deflated 0%)
    step 2) move the AppIcons.jar in the ClassPATH specified by env file(envFile=formsdemo.env)
    in my case the classpath looks like below
    and I have moved the AppIcons.jar to C:\DevSuiteHome_1\forms\demos\my_app
    CLASSPATH=C:\DevSuiteHome_1\jlib\debugger.jar;C:\DevSuiteHome_1\forms\demos\my_app\AppIcons.jar;C:\DevSuiteHome_1\forms\demos\jars\uploadserver.jar;C:\DevSuiteHome_1\forms\demos\jars\demowebserviceclientside.jar;C:\DevSuiteHome_1\jdk\jre\lib\rt.jar;C:\DevSuiteHome_1\forms\demos\jars\javamailintegration.jar;C:\DevSuiteHome_1\forms\demos\jars\mail.jar;C:\DevSuiteHome_1\forms\demos\jars\activation.jar
    step 3) shutdown and restart the OC4J
    To Answer Slava's question:
    2. Check Jinitiator console and see if AppIcons.jar is loaded.
    You should see :
    Loading http://host:port/forms/java/AppIcons.jar from JAR cache
    YES its loading prefectly.
    To answer Magoo's questions:
    q)What is the incorrect image look like? Somehting like a broken link image?
    Yes,the image is a small page icon which is broken like a torn page(and has three small solid figures in it)
    q)Do you get there a message like Unable to load image 111.gif for Image Item ?
    No I do not get any error message.
    What next ?
    rgds
    s

  • Problem using parameters in dynamic image loading

    Hello experts!!!
    I am using Crystal Reports 2008.  I am trying to make use of a class servlet application that returns an image based on a number of parameters.  I have put a formula behind a default image that should access the servlet and change the image at runtime.
    This works fine in the CR2008 designer.  However when it is published to my webapp, it doesn't work. 
    The problem is that for some reason, something somewhere is removing the '?' before the parameters in the URL.
    My formula
    "http://localhost:8080/demoMYSQL/servlet/em.cabbench.CabBenchSrv?requestType=getStaticDrawing&imageType=2D&scale=1.6&layerscale3d=0.03&extrusionlength3d=0.4&corelabellevel=1&solid=1&topLevel=1&userid=admin&password=admin&design=" + {designHeader/header/headerAtt.design}
    Image loading in designer
    [http://farm4.static.flickr.com/3503/3179649422_ebd760fa61.jpg?v=0]
    Web application log showing correct path name /em.cabbench.CabBenchSrv to servlet and a succesful request
    /em.cabbench.CabBenchSrv
    1231497711203|10:41:51:203|/demoMYSQL|null|requestType=getStaticDrawing&design=MV-120-XLPE-001&layerscale3d=0.03&scale=1.6&imageType=2D&userid=admin&topLevel=1&solid=1&extrusionlength3d=0.4&corelabellevel=1
    10:41:51:218  binding session 872DB3467263966DC9D5CEBB645C8A5D
    Image loading in viewer - NOT WORKED, default image displayed
    [http://farm4.static.flickr.com/3126/3179649516_5df47fa7fd.jpg?v=0]
    Web application showing incorrect path name to servlet because '?' is missing - result = null request!
    /em.cabbench.CabBenchSrvrequestType=getStaticDrawing&design=MV-120-XLPE-001&imageType=2D&scale=1.6&layerscale3d=0.03&extrusionlength3d=0.4&corelabellevel=1&solid=1&topLevel=1&userid=admin&password=admin&design=MV-120-XLPE-001
    1231498144859|10:49:4:859|/demoMYSQL|null|requestType=null
    1231498144859|10:49:4:859|End of
    Has anybody got any ideas of what to do with the question mark and how to get the image to change properly?????? Like it is doing in the report designer!
    Best Regards
    Nick Hirst

    Hi Nick,
    Since, the issue you have is with the web app only, I would request you to post this thread on the Dev Forum.
    Please click on the appropriate link below: -
    For .Net - SAP Crystal Reports, version for Visual Studio
    For Java - SAP Crystal Reports, version for Eclipse
    The people there would be the perfect people to help you with this.
    Hope this helps.
    Regards,
    Jay.

  • Image loading cache memory issue

    Hi All,
    I am facing an interesting problem about cache memory. Let me explain it using an example.
    Let say, an xml file contains 5 images information. I want to load a image on stage one by one but randomly ( not on the sequence of XML items). This is working fine.
    Now, i am coming to the issue. If user start the application. Then let say, "image 1" is loaded first and "image 3" is loaded second. Now user's internet connection is lost then i want to show image 1 only and then when user's internet is connected start the ramdom image loading as normal.
    Hope anyone guide me about how to achive the goal !!
    Thanks in Advance.
    Bharat Patel

    you can use the sharedobject class to determine how long ago the user logged in and the sequence of images that you want to display.

  • Draw image to JPane in NetBeans

    I am developing a GUI in NetBeans that is for changing the settings.
    one setting is a username and password.
    once the user has inputed a username and password it needs to show a GIF image which is a loading kinda circle thing that goes around i don't have a problem with knowing when to show the image and start the request it is just the showing the image bit at the moment i have this code:
    public ConfigGUI() {
         initComponents();
         center();
         System.out.println("Loading image");
         Graphics loginGraphics = loginPane.getGraphics();
         LoadImageApp image = new LoadImageApp("resources/strawberry.jpg");
         loginGraphics.drawImage(image.img, 1, 1, null);
         loginPane.repaint();
         loginPane.setVisible(true);
         System.out.println("Image loaded");
        /* image class */
        public class LoadImageApp extends Component {
         BufferedImage img;
         //@Override
         public void paint(Graphics g) {
             g.drawImage(img, 0, 0, null);
         public LoadImageApp(String filename) {
             try {
              img = ImageIO.read(new File(filename));
             } catch (IOException e) {
              System.out.println("Failed to load image");
         //@Override
         public Dimension getPreferredSize() {
             if (img == null) {
              return new Dimension(100, 100);
             } else {
              return new Dimension(img.getWidth(null), img.getHeight(null));
        }but it doesn't work.
    am i using the right kind of components or do i need to use something other than a JPane?
    and what code should i be using to output the image?
    Scott.

    If you're using Swing here, I wonder if you should draw in either a JPanel or a JComponent, but not in a Component. Also, if you do use either JPanel or JComponent, then you should override the paintComponent method not paint. If this suggestion doesn't help, then consider posting an [SSCCE,|http://sscce.org] but if you do so, I recommend that it be very very simple and not be NetBeans-generated.
    Good luck.
    edit: on second look your code looks a little odd. Why are you loading an image into a component but not viewing it in that component, but instead pulling out the image variable and using it elsewhere? It looks a bit strange but perhaps you have a good reason for doing it this way? Have you read the Sun graphics tutorials yet? if not, they are quite well written.
    Edited by: Encephalopathic on Nov 20, 2008 5:07 PM

  • Same image, loaded multiple times: speeding up load time?

    I wrote this message before thinking about embedding the
    image... I was thinking that putting a relative path automatically
    embedded the image, but in retrospect I was wrong, and that will
    probably solve my problem. I'll just leave the question here anyway
    though:
    I'm using image components in my application loaded from a
    relative path. The problem is, I have many copies (30+) of the same
    image, essentially 30+ identical image components which need to be
    loaded/unloaded at different intervals, and they are not loading
    fast enough for me. Would it be more effective to duplicate an
    existing "master" Image to improve load time instead of explicitly
    setting "image.source=" each time? Is there any better solution for
    improving image load speed?
    Best of all would be some way to pre-cache or buffer images,
    so that I can be guaranteed that they will load as quickly as
    possible when I bind them to an Image component.
    Cheers!

    JPGS are much better for photos.  PNGs are good when you need transparency.
    Instead of Image Swapping, why don't you use a photo gallery?
    FancyBox is nice..  It supports real text captions/descriptions, too.
    http://fancybox.net/
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb
    http://alt-web.blogspot.com/

  • Question about image loading problem

    Dear Java Gurus,
    I am writing a simple Java Applet application. Basically what it does is every 3 seconds, it tries to get an image from a server and display it (also based on the browser�s client size to do some resize of the image to fit the width of the browser�s client area). But frequently I got this kind of exceptions:
    ----------------------------- Exception 1 --------------------------------------
    Uncaught error fetching image:
    java.lang.ArrayIndexOutOfBoundsException
    at java.lang.System.arraycopy(Native Method)
    at sun.awt.image.PNGFilterInputStream.read(Unknown Source)
    at java.util.zip.InflaterInputStream.fill(Unknown Source)
    at java.util.zip.InflaterInputStream.read(Unknown Source)
    at java.io.BufferedInputStream.fill(Unknown Source)
    at java.io.BufferedInputStream.read1(Unknown Source)
    at java.io.BufferedInputStream.read(Unknown Source)
    at sun.awt.image.PNGImageDecoder.produceImage(Unknown Source)
    at sun.awt.image.InputStreamImageSource.doFetch(Unknown Source)
    at sun.awt.image.ImageFetcher.fetchloop(Unknown Source)
    at sun.awt.image.ImageFetcher.run(Unknown Source)
    ----------------------------- Exception 2 ------------------------------------------
    sun.awt.image.PNGImageDecoder$PNGException: crc corruption
    at sun.awt.image.PNGImageDecoder.getChunk(Unknown Source)
    at sun.awt.image.PNGImageDecoder.getData(Unknown Source)
    at sun.awt.image.PNGFilterInputStream.read(Unknown Source)
    at java.util.zip.InflaterInputStream.fill(Unknown Source)
    at java.util.zip.InflaterInputStream.read(Unknown Source)
    at java.io.BufferedInputStream.fill(Unknown Source)
    at java.io.BufferedInputStream.read1(Unknown Source)
    at java.io.BufferedInputStream.read(Unknown Source)
    at sun.awt.image.PNGImageDecoder.produceImage(Unknown Source)
    at sun.awt.image.InputStreamImageSource.doFetch(Unknown Source)
    at sun.awt.image.ImageFetcher.fetchloop(Unknown Source)
    at sun.awt.image.ImageFetcher.run(Unknown Source)
    Which will cause the image goes to blank in the browser and also degreed down the performance, and I do not know where they are coming from. I tried to put try-catch blocks at possible method calls, but still it does not catch these kind exceptions.
    ---------------------------- My Source Code ----------------------------
    import java.io.*;
    import java.awt.*;
    import java.net.*;
    import java.util.*;
    import java.applet.*;
    import javax.swing.*;
    import java.awt.event.*;
    // This is for Popup Menu
    class PopupListener extends MouseAdapter
    JPopupMenu popup;
    PopupListener(JPopupMenu popupMenu)
    popup = popupMenu;
    public void mousePressed(MouseEvent e)
    maybeShowPopup(e);
    public void mouseClicked(MouseEvent e)
    maybeShowPopup(e);
    public void mouseReleased(MouseEvent e)
    maybeShowPopup(e);
    private void maybeShowPopup(MouseEvent e)
    if (e.isPopupTrigger())
    popup.show(e.getComponent(), e.getX(), e.getY());
    // Image Component who contains the image and will be hosted in the ScrollPane
    class ImageComponent extends JComponent
    Image onscrImage;
    Dimension comSize;
    ImageComponent(Image image)
    onscrImage = image;
    setDoubleBuffered(true);
    comSize = new Dimension(onscrImage.getWidth(null), onscrImage.getHeight(null));
    setSize(comSize);
    public synchronized void paint(Graphics g)
    super.paint(g);
    g.drawImage(onscrImage, 0, 0, this);
    public Dimension getPreferredSize()
    return comSize;
    // Update the image with new image
    public void setImage(Image img)
    onscrImage = img;
    comSize = new Dimension(onscrImage.getWidth(null), onscrImage.getHeight(null));
    setSize(comSize);
    // The main Applet hosted in the browser
    public class MWRemotingApplet extends JApplet
    //Media Tracker to manage the Image loading
    MediaTracker medTracker;
    Image my_Image;
    // ScollPane who contains the image component
    JScrollPane scrollPane;
    ImageComponent imgComp;
    // The applet base URL and image filename passed from htm who hosted the Applet
    URL base;
    String filename;
    // Schedules getting the image
    private java.util.Timer timer;
    private int delay = 3000;
    private boolean bFitToBrowser = false;
    private int iVScrollbarWidth = 20;
    // Popup Menu
    JPopupMenu jPopupMenu;
    JMenuItem popupMenuItem;
    public void init()
    // Set the layout to GridLayout then the it can fill in the Applet
    setLayout(new GridLayout());
    try
    // getDocumentbase gets the applet path.
    base = getCodeBase();
    // Get the image file name from the parameter
    filename = getParameter("filename");
    catch (Exception e)
    JOptionPane.showMessageDialog(null, "Failed to get the path and filename of the image!", "Message", 0);
    return;
    // Create the Media Tracker
    medTracker = new MediaTracker(this);
    // Download the image from the remote server
    // If the image width is greater than the width of the current browser client area
    // Resize the image to fit the width
    // This is because for some reason, this will lead to image not refreshing
    DownloadImage();
    //Add the popup menu
    jPopupMenu = new JPopupMenu();
    popupMenuItem = new JMenuItem("Fit to Browser");
    popupMenuItem.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent event) {
    bFitToBrowser = !bFitToBrowser;
    if(bFitToBrowser)
    popupMenuItem.setText("Original Size");
    FitToBrowser();
    else
    popupMenuItem.setText("Fit to Browser");
    DownloadImage();
    if(my_Image != null)
    imgComp.setImage(my_Image);
    jPopupMenu.add(popupMenuItem);
    // Create the image component
    imgComp = new ImageComponent(my_Image);
    //Add listener to the image component so the popup menu can come up.
    MouseListener popupListener = new PopupListener(jPopupMenu);
    imgComp.addMouseListener(popupListener);
    // Create the scroll pane
    scrollPane = new JScrollPane(imgComp);
    scrollPane.setDoubleBuffered(true);
    // Catch the resize event of the Applet
    addComponentListener(new ComponentAdapter()
    public void componentResized(ComponentEvent e)
    super.componentResized(e);
    if(bFitToBrowser)
    FitToBrowser();
    else
    DownloadImage();
    if(my_Image != null)
    imgComp.setImage(my_Image);
    //Add Components to the Applet.
    add("Center", scrollPane);
    validate();
    // Start the timer to periodically download image
    // from remote server
    public void start()
    timer = new java.util.Timer();
    timer.schedule(new TimerTask()
    //creates a timertask to schedule
    // overrides the run method to provide functionality
    public void run()
    DownloadImage();
    if(my_Image != null)
    imgComp.setImage(my_Image);
    , 0, delay);
    public void stop()
    timer.cancel(); //stops the timer
    public synchronized void DownloadImage()
    if(my_Image != null)
    my_Image.flush();
    my_Image = null;
    try
    my_Image = getImage(base, filename);
    catch (Exception e)
    my_Image = null;
    return;
    medTracker.addImage( my_Image, 0 );
    try
    medTracker.waitForAll();
    if ( my_Image != null )
    medTracker.removeImage(my_Image);
    catch (InterruptedException e)
    JOptionPane.showMessageDialog(null, "waitForAll failed while downloading the image!", "Message", 0);
    catch(Exception e1)
    System.out.println("Get Exception = " + e1.getMessage());
    e1.printStackTrace();
    if(bFitToBrowser)
    FitToBrowser();
    else if(my_Image.getWidth(null) > this.getSize().width)
    FitToWidth();
    // Resize the image to fit the browser width and height
    public synchronized void FitToBrowser()
    if(my_Image != null)
    my_Image = my_Image.getScaledInstance(this.getSize().width - 5, this.getSize().height - 5, java.awt.Image.SCALE_SMOOTH);//java.awt.Image.SCALE_AREA_AVERAGING);//java.awt.Image.SCALE_SMOOTH);
    medTracker.addImage( my_Image, 0 );
    try
    medTracker.waitForAll();
    medTracker.removeImage(my_Image);
    catch (InterruptedException e)
    JOptionPane.showMessageDialog(null, "waitForAll failed!", "Message", 0);
    catch (Exception e1)
    System.out.println("Get Exception = " + e1.getMessage());
    e1.printStackTrace();
    // Resize the image to fit the browser width only
    public synchronized void FitToWidth()
    if(my_Image != null)
    int fitHeight = (int)((this.getSize().width - iVScrollbarWidth)*(my_Image.getHeight(null)+0.0)/my_Image.getWidth(null));
    my_Image = my_Image.getScaledInstance(this.getSize().width - iVScrollbarWidth, fitHeight, java.awt.Image.SCALE_SMOOTH);
    medTracker.addImage( my_Image, 0 );
    try
    medTracker.waitForAll();
    medTracker.removeImage(my_Image);
    catch (InterruptedException e)
    JOptionPane.showMessageDialog(null, "waitForAll failed!", "Message", 0);
    catch (Exception e1)
    System.out.println("Get Exception = " + e1.getMessage());
    e1.printStackTrace();
    }

    [url http://forum.java.sun.com/thread.jsp?thread=518979&forum=14]Please[url http://forum.java.sun.com/thread.jsp?thread=518977&forum=32] do[url http://forum.java.sun.com/thread.jsp?thread=518973&forum=37] not[url http://forum.java.sun.com/thread.jsp?thread=518978&forum=42] crosspost. Or [url http://forum.java.sun.com/thread.jsp?forum=7&thread=518976]double-post. Or post to the wrong forum. Or use non-sense subject.

  • Clicking Sound When Images Load

    Greetings,
    I am getting a faint clicking noise whenever images load onto the screen - such as on the internet, or when an application opens. Also, I get the sound when I scroll on a web page with my external mouse. Any ideas? Many thanks!

    Albert:
    • Are you able to detect the location of the clicking sound? That is, does is come out of the speakers, or from somewhere else on the computer, like under the keyboard etc.?
    • Do you have the original HDD in the computer? While booted from the computer go to Apple Menu > About this Mac > More Info > Hardware > ATA. On the right pane at the top you will see ATA device tree. The first ATA Bus entry is your internal HDD. Select it, then go to the second section and doubleclick on the ID, copy and paste is in your response.
    The sounds you describe are most commonly associated with the internal HDD and we need to eliminate that as the cause. If it seems to be coming from the speakers, turn the sound off, and see if it makes a difference.
    Good luck.
    cornelius

  • Loading Images/Having images load at the center of a JFrame with random col

    Hey Guys,
    I was wondering how could i go about loading images two at a time for instance have two circle images load at the center of a J Frame connected to each other and also each time the J Frame is executed the circles are different colors. Ive posted this question before and have posted it on another forum but i have not gotten any help. I looked into using media tracker and the Random command but i am still not if these are the proper solution to my problem. Id appreciate any help if this post doesn't make sense let me know i will try and clarify better. Thanks in advance

    Ah alright then so what i have to far is i have an image load to my J Frame/J Panel and after it loads it starts to fall like a tetris block and i am able to move it left and right. When the image loads it loads to the default coordinates of 0,0 the left hand top corner. What i want to do it when i run my application the image loads at the center of the J Frame/J Panel but also have another block connected to it when it loads. So basically i have loaded four separate different images and want them to load to my J Frame/ J Panel two at a time side by side like tetris and puyo puyo smashed together here is my code sorry its hard for me to explain it for some reason hope this makes more sense.
    import javax.swing.*;
    import java.awt.*;
    public class DemoTest extends JPanel {
         public DemoTest() {
            add(new BlockPanel());
        public static void main(String[] args) { {
        JFrame frame = new JFrame("Tetris");
        frame.setContentPane(new BlockPanel());
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(200,500);
        frame.setResizable(false);
        frame.setVisible(true);
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class BlockAnimation extends JPanel {
      public static final int numDroppingBlocks=2;
      private static final int MAX_X = 200;
      private static final int MAX_Y = 430;
      private static final int DELTA_Y = 2;
      private static final int TIMER_DELAY = 20;
       // Declare name's for the Image object.
       Image image[];
       Timer pptimer;
       boolean right,left;
       int X = 0;
       int x = 32;
       int y;
    public BlockAnimation() {
          super();
          //Load an image file into the Image object. This file has to be in the same folder
          image = new Image[4];
          image[0] = Toolkit.getDefaultToolkit().getImage("block_yellow.png");
          image[1] = Toolkit.getDefaultToolkit().getImage("block_blue.png");
          image[2] = Toolkit.getDefaultToolkit().getImage("block_green.png");
          image[3] = Toolkit.getDefaultToolkit().getImage("block_red.png");
        //image5 = Toolkit.getDefaultToolkit().getImage("DeathNote1.jpg");
          setFocusable(true);
          BlockMove block_move = new BlockMove(); // Make a new video game KeyListener
          addKeyListener(block_move);
          //setBackground(Color.BLACK);
          pptimer = new Timer(TIMER_DELAY, new TimerAction());
          pptimer.start();
            public void setAnimation(boolean OnandOff) {
            if (OnandOff) {
                pptimer.start(); 
            } else {
                pptimer.stop(); 
            public void paintComponent(Graphics g) {
             super.paintComponent(g); 
             // draw the "stop" line for the animation
             g.setColor(Color.black);
             g.drawLine(0, MAX_Y, getWidth(), MAX_Y);
                // Draw our Image object.
           g.drawImage(image[0],X,y,this);
             if(right) // Move the block to the right
                   X++;
                   if(left) // Move the block to the left
                  X--;
                 repaint();
         private class BlockMove implements KeyListener {
         public void keyTyped(KeyEvent e){}
          public void keyReleased(KeyEvent e)
           if(e.getKeyCode() == e.VK_RIGHT)
            right = false;
            if(e.getKeyCode() == e.VK_LEFT)
              left = false;
                   public void  keyPressed(KeyEvent e)
                  if(e.getKeyCode() == e.VK_RIGHT)
                             right = true;
                        if(e.getKeyCode() == e.VK_LEFT)
                             left = true;
            class TimerAction implements ActionListener {
            public void actionPerformed(ActionEvent e) {
                 y += DELTA_Y;
                if (y + x  >= MAX_Y) {
                setAnimation(false);
    }//end class
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    class BlockPanel extends JPanel {
       BlockAnimation pa;  
        BlockPanel() {
            pa = new BlockAnimation();       
            JButton startButton = new JButton("Start");       
            JButton stopButton  = new JButton("Stop");
            startButton.addActionListener(new Start());
            stopButton.addActionListener(new Stop());
            JPanel button = new JPanel();
            button.setLayout(new FlowLayout());
            button.add(startButton);
            button.add(stopButton);
            this.setLayout(new BorderLayout());
            this.add(button, BorderLayout.SOUTH);
            this.add(pa,BorderLayout.CENTER);
        class Start implements ActionListener {
            public void actionPerformed(ActionEvent e) {
                pa.setAnimation(true);
        class Stop implements ActionListener {
            public void actionPerformed(ActionEvent e) {
                pa.setAnimation(false);
    }//endclass Edited by: Riz01 on Sep 14, 2009 2:34 PM

Maybe you are looking for

  • Print preview for PO PR and RFQ

    Dear All, i have created Purchase requsition and purchase order and request for quotation and now i want to display thier printouts,,,, system is not showing any print out ,, may b it requires to set output message types please guide how set the sett

  • How do I stop scrolbars in a DIV in Netscape

    Hi I have a containing DIV which displays fine in Firefox and IE, but when it's dynamic data extends too low, scrollbars appear within the DIV (only in Netscape). What do I put in the CSS to stop this? Cheers Shaun

  • Can I use Oracle Express Edition for Educational purposes?

    Dears, I have an Information Technology school and I'm wondering if I can use Oracle Express Edition for Educational purposes. Do I need any special licenses for this? I noticed the following statement on Oracle 11g Express download (Oracle Database

  • Selection screen -greater than

    I want to write a code in the program  for the condition where i say the selection screen value is greater than mara-prdha.(Also for the levels of this field) Prdha is product hierachy and has different levels .So Is it possible to restrict it based

  • Release actual cost in Material Ledger

    Dear Experts I want to copy the actual cost of period 1 to be standard of period 2. I did the following activities: 1- I run all steps for standard cost estimates for year 2012 and released the standard cost estimate for periods 1-12. 2- On January 2