Problem while encoding JPEG image from JFrame paintComponent in a servlet

Hello!
I m developing webapplication in which I made one servlet that calls JFrame developed by me, and then encoding into JPEG image to send response on client browser. I m working on NetBeans 5.5 and the same code runs well. But my hosting server is Linux and I m getting the following error:
java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
     java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
     java.awt.Window.<init>(Window.java:406)
     java.awt.Frame.<init>(Frame.java:402)
     java.awt.Frame.<init>(Frame.java:367)
     javax.swing.JFrame.<init>(JFrame.java:163)
     pinkConfigBeans.pinkInfo.pinkModel.pinkChartsLib.PinkChartFrame.<init>(PinkChartFrame.java:36)
     pinkConfigBeans.pinkController.showLastDayRevenueChart.processRequest(showLastDayRevenueChart.java:77)
     pinkConfigBeans.pinkController.showLastDayRevenueChart.doGet(showLastDayRevenueChart.java:107)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.25 logs.
I m building the application in NetBeans and when runs then it runs well, even while browsing from LAN. But when I place the web folder creted under buil directory of NetBeans in the Tomcat on Linux, then it gives above error.
Under given is the servlet code raising exception
response.setContentType("image/jpeg"); // Assign correct content-type
ServletOutputStream out = response.getOutputStream();
/* TODO GUI output on JFrame */
PinkChartFrame pinkChartFrame;
pinkChartFrame = new PinkChartFrame(ssnGUIAttrInfo.getXjFrame(), ssnGUIAttrInfo.getYjFrame(), headingText, xCordText, yCordText, totalRevenueDataList);
pinkChartFrame.setTitle("[::]AMS MIS[::] Monthly Revenue Chart");
pinkChartFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
//pinkChartFrame.setVisible(true);
//pinkChartFrame.plotDataGUI();
int width = 760;
int height = 460;
try {
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = image.createGraphics();
pinkChartFrame.pinkChartJPanel.paintComponent(g2);
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
encoder.encode(image);
} catch (ImageFormatException ex) {
ex.printStackTrace();
response.sendRedirect("index.jsp");
} catch (IOException ex) {
ex.printStackTrace();
response.sendRedirect("index.jsp");
out.flush();
Do resolve anybody!
Edited by: pinkVag on Oct 15, 2007 10:19 PM

>
I m developing webapplication in which I made one servlet that calls JFrame developed by me, and then encoding into JPEG image to send response on client browser. I m working on NetBeans 5.5 and the same code runs well. But my hosting server is Linux and I m getting the following error:
java.awt.HeadlessException: >That makes sense. It is saying that you cannot open a JFrame in an environment (the server) that does not support GUIs!
To make this so it will work on the server, it will need to be recoded so that it uses the command line only - no GUI.
What is it exactly that PinkChartFrame is generated an image of? What does it do? (OK probably 'generate a chart') But what APIs does it use (JFreeChart or such)?

Similar Messages

  • Encoding problem while reading binary data from MQ-series

    Dear all,
    we are running on 7.0 and we have an encoding problem while reading binary data from MQ-series. Because we are getting flat strings from queue we use module "Plain2ML" (MessageTransformBean) for wrapping xml-elements around the incoming data.
    The MQ-Series-Server is using CCSID 850, which we configured in connection parameters in communication channel (both parameters for Queuemanager CCSID and also CCSID of target).If there are special characters in the message (which HEX-values differ from codepage to codepage) we get errors in our adapter while executing, please see stack-trace for further analysis below.
    It seems to us that
    1. method ByteToCharUTF8.convert() expects UTF-8 in binary data
    2. Both CCSID parameters are not used anyway in JMS-adapter
    How can we solve this problem without changing anything on MQ-site?
    Here is the stack-trace:
    Catching com.sap.aii.af.mp.module.ModuleException: Transform: failed to execute the transformation: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException caused by: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException
        at com.sap.aii.af.modules.trans.MessageTransformBean.throwModuleException(MessageTransformBean.java:453)
        at com.sap.aii.af.modules.trans.MessageTransformBean.process(MessageTransformBean.java:387)
        at com.sap.aii.af.mp.module.ModuleLocalLocalObjectImpl0_0.process(ModuleLocalLocalObjectImpl0_0.java:103)
        at com.sap.aii.af.mp.ejb.ModuleProcessorBean.process(ModuleProcessorBean.java:292)
        at com.sap.aii.af.mp.processor.ModuleProcessorLocalLocalObjectImpl0_0.process(ModuleProcessorLocalLocalObjectImpl0_0.java:103)
        at com.sap.aii.adapter.jms.core.channel.filter.SendToModuleProcessorFilter.filter(SendToModuleProcessorFilter.java:84)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.ConvertBinaryToXiMessageFilter.filter(ConvertBinaryToXiMessageFilter.java:304)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.ConvertJmsMessageToBinaryFilter.filter(ConvertJmsMessageToBinaryFilter.java:112)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.InboundDuplicateCheckFilter.filter(InboundDuplicateCheckFilter.java:87)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.TxManagerFilter.filterSend(TxManagerFilter.java:123)
        at com.sap.aii.adapter.jms.core.channel.filter.TxManagerFilter.filter(TxManagerFilter.java:59)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.DynamicConfigurationFilter.filter(DynamicConfigurationFilter.java:72)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.PmiAgentFilter.filter(PmiAgentFilter.java:66)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.InboundCorrelationFilter.filter(InboundCorrelationFilter.java:60)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.JmsHeadersProfileFilter.filter(JmsHeadersProfileFilter.java:59)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageInvocationsFilter.filter(MessageInvocationsFilter.java:89)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.JarmMonitorFilter.filter(JarmMonitorFilter.java:57)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.ThreadNamingFilter.filter(ThreadNamingFilter.java:62)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.SenderChannelImpl.doReceive(SenderChannelImpl.java:263)
        at com.sap.aii.adapter.jms.core.channel.ChannelImpl.receive(ChannelImpl.java:437)
        at com.sap.aii.adapter.jms.core.connector.MessageListenerImpl.onMessage(MessageListenerImpl.java:36)
        at com.ibm.mq.jms.MQMessageConsumer$FacadeMessageListener.onMessage(MQMessageConsumer.java:399)
        at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl$JmsProviderMessageListener.onMessage(JmsMessageConsumerImpl.java:904)
        at com.ibm.msg.client.wmq.v6.jms.internal.MQMessageConsumer.receiveAsync(MQMessageConsumer.java:4249)
        at com.ibm.msg.client.wmq.v6.jms.internal.SessionAsyncHelper.run(SessionAsyncHelper.java:537)
        at java.lang.Thread.run(Thread.java:770)
    Caused by: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException
        at com.sap.aii.messaging.adapter.Conversion.service(Conversion.java:714)
        at com.sap.aii.af.modules.trans.MessageTransformBean.processTransform(MessageTransformBean.java:538)
        at com.sap.aii.af.modules.trans.MessageTransformBean.processTransform(MessageTransformBean.java:528)
        at com.sap.aii.af.modules.trans.MessageTransformBean.processTransform(MessageTransformBean.java:471)
        at com.sap.aii.af.modules.trans.MessageTransformBean.process(MessageTransformBean.java:364)
        ... 36 more
    Caused by: sun.io.MalformedInputException
        at sun.io.ByteToCharUTF8.convert(ByteToCharUTF8.java:270)
        at sun.nio.cs.StreamDecoder$ConverterSD.convertInto(StreamDecoder.java:287)
        at sun.nio.cs.StreamDecoder$ConverterSD.implRead(StreamDecoder.java:337)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:223)
        at java.io.InputStreamReader.read(InputStreamReader.java:208)
        at java.io.BufferedReader.fill(BufferedReader.java:153)
        at java.io.BufferedReader.readLine(BufferedReader.java:316)
        at java.io.LineNumberReader.readLine(LineNumberReader.java:176)
        at com.sap.aii.messaging.adapter.Conversion.convertPlain2XML(Conversion.java:310)
        at com.sap.aii.messaging.adapter.Conversion.service(Conversion.java:709)
        ... 40 more
    Any ideas?
    Kind regards, Stefan

    Hi Stefan,
    for the first MTB now we are using only one parameter: Transform.ContentType = text/plain;charset="ISO-8859-1"
    The second MTB, which does the XML-Wrapping, is configured like this:
    Transform.Class = com.sap.aii.messaging.adapter.Conversion
    Transform.ContentType = application/xml
    xml.conversionType = SimplePlain2XML
    xml.fieldNames = value
    xml.fieldSeparator = §%zulu§%
    xml.processFieldNames = fromConfiguration
    xml.structureTitle = payload
    Both CCSID configuration parameters from the "Source"-Tab we've set to 850.
    Now, we don't get an error anymore - sun.io.malformedInputException - , but, unfortunately, now special character conversion succeeded (we need an "ß" and we get an ISO-HEX-E1 -> á).  E1 is (different from ISO) an "ß" in 850.
    Any ideas?

  • Error While loading a image from database

    Purpose
    Error While loading the Image from the database
    ORA-06502: PL/SQL : numeric or value error:Character string buffer too small
    ORA-06512: at "Sys.HTP" ,line 1480
    Requirement:
    I am developing the web pages using PSP(Pl/sql Serverpages) . I have a requirement to show a image in the webpage. I got the following procedures from the oracle website.
    I have created the following table to store the images
    create table DEMO
    ID INTEGER not null,
    THEBLOB BLOB
    And I also uploaded the Images. Now I am try to get a image from the table using the following procedure .But I am getting the error message line 25( htp.prn( utl_raw.cast_to_varchar2( l_raw ) );) .at it throws the following error messages
    ORA-06502: PL/SQL : numeric or value error:Character string buffer too small
    ORA-06512: at "Sys.HTP" ,line 1480
    Procedure that I used to get the image
    create or replace package body image_get
    as
    procedure gif( p_id in demo.id%type )
    is
    l_lob blob;
    l_amt number default 30;
    l_off number default 1;
    l_raw raw(4096);
    begin
    select theBlob into l_lob
    from demo
    where id = p_id;
    -- make sure to change this for your type!
    owa_util.mime_header( 'image/gif' );
    begin
    loop
    dbms_lob.read( l_lob, l_amt, l_off, l_raw );
    -- it is vital to use htp.PRN to avoid
    -- spurious line feeds getting added to your
    -- document
    htp.prn( utl_raw.cast_to_varchar2( l_raw ) );
    l_off := l_off+l_amt;
    l_amt := 4096;
    end loop;
    exception
    when no_data_found then
    NULL;
    end;
    end;
    end;
    What I have to do to correct this problem. This demo procedure and table that I am downloaded from oracle. Some where I made a mistake. any help??
    Thanks,
    Nats

    Hi Satish,
    I have set the raw value as 3600 but still its gives the same error only. When I debug the procedure its throwing the error stack in
    SYS.htp.prn procedure of the following line of code
    if (rows_in < pack_after) then
    while ((len - loc) >= HTBUF_LEN)
    loop
    rows_in := rows_in + 1;
    htbuf(rows_in) := substr(cbuf, loc + 1, HTBUF_LEN);
    loc := loc + HTBUF_LEN;
    end loop;
    if (loc < len)
    then
    rows_in := rows_in + 1;
    htbuf(rows_in) := substr(cbuf, loc + 1);
    end if;
    return;
    end if;
    Its a system procedure. I don't no how to proceed .. I am really stucked on this....is their any other method to take picture from the database and displayed in the web page.....???? any idea..../suggesstion??
    Thanks for your help!!!.

  • I need to select to import only low-res jpeg images from my Canon 5D Mk11 camera to an iPad 2 and not RAW images

    I need to select somehow to import only jpeg images from my Canon 5D Mk11 camera to an iPad 2
    I take photographs in both RAW (high quality up to 30Mb file size) and JPEG low quality for use on iPad and Internet. The Raw files I save to a 1Tb Multimedia Storage Viewer and later down load-them to my computer where I process them for high quality prints.
    Using the Camera Kit I can’t find an option to only download jpeg images, and fill the iPad memory with unwanted RAW images. Can you please tell me how to get over this problem?

    Have you checked your "Import" settings for "Raw&Jpeg" pairs in the "Import" panel?
    You can set Aperture to import raw, jpeg, or raw&jpeg.
    If you imported Raw&Jpeg, but have set Aperture to use the Jpeg as original, you will see the imported image as Jpeg image, not as a raw image, even if the raw has also been imported. You can switch between Raw and Jpeg originals for selected images from the Photos menu:
    Photos > Use Raw as original.
    Regards
    Léonie

  • Importing jpeg images from camera to IPhoto

    I get the following error message when uploading jpeg images from my camera to IPhoto in my macbook air- "iPhoto cannot import your photos because there was a problem downloading an image".- any ideas?
    If I try to import just one image at the time I get the following error-
    "The following file cannot be imported. The file is in an unrecognisable format"

    What version of iPhoto? Of the OS? What camera? Does your camera mount to the desktop? Have you tried image capture? Have you tried a USB card reader? When did you last reformat your camera memory card using the camera's format command?
    LN

  • Problem while exporting the data from a report to an excel file.

    Hi SAP guru's,
    I have a problem while exporting the data from a report to an excel file.
    The problem is that after exporting, the excel file seems to have some irrelevant characters....I am checking this using SOST transaction..
    Required text (Russian):
    Операции по счету                                    
    № документа     Тип документа     № учетной записи     Дата документа     Валюта     Сумма, вкл. НДС     Срок оплаты     Описание документа
    Current Text :
       ? 5 @ 0 F 8 8  ? >  A G 5 B C                                   
    !   4 > : C       "" 8 ?  4 > : C      !   C G 5 B = > 9  7 0 ? 8 A 8        0 B 0  4 > : C         0 ; N B 0      ! C <       ! @ > :  > ? ; 0 B K        ? 8 A 0 = 8 5  4 > : C
    Can you help me making configuration settings if any?
    Regards,
    Avinash Raju

    Hi Avinash
    To download  such characteres you need to adjust code page to be used during export. You can review SAP note 73606 to identify which code page is required for this language
    Best regards

  • Problem  while reading XML file from Aplication server(Al11)

    Hi Experts
    I am facing a problem while  reading XML file from Aplication server  using open data set.
    OPEN DATASET v_dsn IN BINARY MODE FOR INPUT.
    IF sy-subrc <> 0.
        EXIT.
      ENDIF.
      READ DATASET v_dsn INTO v_rec.
    WHILE sy-subrc <> 0.
      ENDWHILE.
      CLOSE DATASET v_dsn.
    The XML file contains the details from an IDOC number  ,  the expected output  is XML file giving  all the segments details in a single page and send the user in lotus note as an attachment, But in the  present  output  after opening the attachment  i am getting a single XML file  which contains most of the segments ,but in the bottom part it is giving  the below error .
    - <E1EDT13 SEGMENT="1">
      <QUALF>001</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803<The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource 'file:///C:/TEMP/notesD52F4D/SHPORD_0080005842.xml'.
    /SPAN></NTEND>
      <NTENZ>000000</NTENZ>
    for all the xml  its giving the error in bottom part ,  but once we open the source code and  if we saved  in system without changing anything the file giving the xml file without any error in that .
    could any one can help to solve this issue .

    Hi Oliver
    Thanx for your reply.
    see the latest output
    - <E1EDT13 SEGMENT="1">
      <QUALF>003</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803</NTEND>
      <NTENZ>000000</NTENZ>
      <ISDD>00000000</ISDD>
      <ISDZ>000000</ISDZ>
      <IEDD>00000000</IEDD>
      <IEDZ>000000</IEDZ>
      </E1EDT13>
    - <E1EDT13 SEGMENT="1">
      <QUALF>001</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803<The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource 'file:///C:/TEMP/notesD52F4D/~1922011.xml'.
    /SPAN></NTEND>
      <NTENZ>000000</NTENZ>
    E1EDT13 with QUALF>003 and  <E1EDT13 SEGMENT="1">
    with   <QUALF>001 having almost same segment data . but  E1EDT13 with QUALF>003  is populating all segment data
    properly ,but E1EDT13 with QUALF>001  is giving in between.

  • Problem while dowloading the file from Application Server

    Dear Experts,
                 I am facing the Problem while downloading the file from Application server.
    We done the automatic function while saving the invoice, this will create an idoc, and this idoc is written in the Application Server.
    I am running the Transaction AL11 and select the record, and from menu --> List, i am downloading into TXT format.
    But for some segments, the length is long, and so the last 3 to 4 fields values are not appearing in the File. Even though i am unable to view the values in the file before downloading. But i can view in IDOC.
    Please help me to solve this issue.
    Thanks & Regards,
    Srini

    but our user will use the Txn. AL11 and they will download from there
    Educate the user On a serious note, tell him this is not how data from app server should be downloaded. You can ask him to talk to the basis team to provide him access to the app server folder where the file is being stored.
    I can set the Variant and put this in background, But always the file name will be change, Like we use Time stamp in the File name.
    You can't automate this process by scheduling in BG mode. This is because the in BG mode you can't dwld the file to presentation server.
    Hope i'm clear.
    BR,
    Suhas

  • Facing a Problem while downloading the data from ALV Grid to Excel Sheet

    Hi Friends,
    Iam facing a problem while downloading the data from ALV Grid to excel sheet. This is working fine in Development server , when comes to Quality and Production servers I have this trouble.
       I have nearly 11 fields in ALV Grid and out of which one is PO number of length 10 , all the ten numbers are visible in the excel sheet if we download it from development server but when we download it from Quality or Production it is showing only 9 numbers.
    Can any one help me out in this case.

    hi...
    if this problems happens dont display the same internal as u finally got.
    just create new internal table without calling any standard data elements and domains... but the new internal table s similar like ur final internal table and move all the values to new int table.
    for eg.
    ur final internal int table for disp,
         data : begin of itab occur 0,
                        matnr like mara-matnr,
                   end of itab.
    create new like this,
               data : begin of itab occur 0,
                        matnr(12) type N,
                   end of itab.

  • Experiencing the problems while encoding the barcode with Code 128 font

    Hi Tim,
    Hope you are doing good.
    We are experiencing the problems while encoding the barcode with Code 128 font.we have followed the Oracle BI Publisher Blog i.e Barcoding 102 http://blogs.oracle.com/xmlpublisher/discuss/msgReader$281.
    Before applying the encoding Java class we were able to display the barcode but after applying this encoding Java class we are not able to display the barcode.
    We are requesting you to help us for encoding the barcode with Code 128 font and read barcode by scanner.
    We will appreciate and thankful if anybody help us in this regard
    Thanks,
    SubbaRao.

    Hi Tim,
    I am trying to create 128 Barcode, output shows little junk characters. I followed the your "Barcoding 102 instrucitons but no luck. I apprciate your help if you provide some help on this.
    http://blogs.oracle.com/xmlpublisher/2006/06/06
    1. Created Java class under $JAVA_TOP/oracle/apps/oracle/xdo/template/util/barcoder
    2. Registeted and applied the format the barcode to the form field. I will sedn my XML, RTF and Java class, Would you pleae advice me on this
    Thanks
    Venu

  • How do i create a jpeg image from clips in fcp

    how do i/can I create a jpeg image from clips in fcp?
    Stephen

    Select clip in timeline and place the playhead over the frame you want to save as a JPEG. Open the share window ( Button on far right of tool bar) and select 'Save current frame'. If you don't see that option click on add destination and select the Save current frame choice. It will be added to your share options.

  • Dreamweaver encountered problems while constructing the menus from the current menus.xml file

    So, after having trouble with my Photoshop scratch disk, I had to do an archive and install of my Mac OS 10.6.1 then reinstall the Adobe suite. I then had to run the Licensing Repair Tool (http://www.adobe.com/support/contact/licensing.html).
    Now everything works but Dreamweaver, which is throwing the following error:
    "Dreamweaver encountered problems while constructing the menus from the current menus.xml file.
    Please delete the current menus.xml file and rename menus.bak to menus.xml"
    I tried that. menus.bak is a directory, not a file. Even renaming the directory didn't work.
    I saw this http://forums.adobe.com/message/2188511#2188511
    but I don't have a /FlashPlayerTrust/ directory, nor do I see what that has to do with Dreamweaver.
    I couldn't find a corresponding solution for this http://forums.adobe.com/message/862339#862339 for the Mac OS.
    This http://forums.adobe.com/message/3396334#3396334 didn't help, either.
    Anybody have any ideas?
    Thanks!

    This is the error I got after deleting (moving) the configuration directory.
    "No document types have been found in the Configuration/DocumentTypes/ folder. The MMDocumentTypes.xml file may be missing or corrupted. The application will exit now."
    I've reinstalled the entire Adobe CS4 (which fixed my Photoshop problem but created this Dreamweaver problem) and then reinstalled Dreamweaver alone.
    I've also attached a screenshot of the Dreamweaver directory tree with the menus.xml files.

  • How do I transfer a jpeg image from my desktop to pages on my ipad2

    How do I transfer a jpeg image from my desktop to pages on my ipad2 ? Need to prepare a document urgently !!

    Well you actually need to provide some details to get assistance
    Why will it "not allow it?"
    If you have exported to a finder folder on the desk top then your issue is not an iPhoto issue but a system issue - but to resolve it exact details are needed including exact error messages
    The general answer to moving a folder from the desktop to an external drive it to drag it there
    LN

  • Problem displaying CMYK jpeg images

    I have a problem with a CMYK jpeg image.
    I know that about supported JPEGs in JRE - JCS_CMYK and JCS_YCCK are not supported directly.
    And I found here how to load the image:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4799903
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5100094
    I used both the suggestions described to load it, but when the image is displayed the colors are wrong, are very different from the one displayed in PhotoShop, for example.
    Any suggestion are very appreciated. If it's necessary i can send you the image.
    Roberto
    Here is the code
    package com.cesarer.example.crop;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.io.*;
    import java.util.Iterator;
    import javax.imageio.ImageIO;
    import javax.imageio.ImageReader;
    import javax.imageio.stream.ImageInputStream;
    import javax.swing.*;
    import javax.swing.event.MouseInputAdapter;
    public class CroppingRaster extends JPanel
        BufferedImage image;
        Dimension size;
        Rectangle clip;
        boolean showClip;
        public CroppingRaster(BufferedImage image)
            this.image = image;
            size = new Dimension(image.getWidth(), image.getHeight());
            showClip = false;
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            int x = (getWidth() - size.width)/2;
            int y = (getHeight() - size.height)/2;
            g2.drawImage(image, x, y, this);
            if(showClip)
                if(clip == null)
                    createClip();
                g2.setPaint(Color.red);
                g2.draw(clip);
        public void setClip(int x, int y)
            // keep clip within raster
            int x0 = (getWidth() - size.width)/2;
            int y0 = (getHeight() - size.height)/2;
            if(x < x0 || x + clip.width  > x0 + size.width ||
               y < y0 || y + clip.height > y0 + size.height)
                return;
            clip.setLocation(x, y);
            repaint();
        public Dimension getPreferredSize()
            return size;
        private void createClip()
            clip = new Rectangle(140, 140);
            clip.x = (getWidth() - clip.width)/2;
            clip.y = (getHeight() - clip.height)/2;
        private void clipImage()
            BufferedImage clipped = null;
            try
                int w = clip.width;
                int h = clip.height;
                int x0 = (getWidth()  - size.width)/2;
                int y0 = (getHeight() - size.height)/2;
                int x = clip.x - x0;
                int y = clip.y - y0;
                clipped = image.getSubimage(x, y, w, h);
            catch(RasterFormatException rfe)
                System.out.println("raster format error: " + rfe.getMessage());
                return;
            JLabel label = new JLabel(new ImageIcon(clipped));
            JOptionPane.showMessageDialog(this, label, "clipped image",
                                          JOptionPane.PLAIN_MESSAGE);
        private JPanel getUIPanel()
            final JCheckBox clipBox = new JCheckBox("show clip", showClip);
            clipBox.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    showClip = clipBox.isSelected();
                    repaint();
            JButton clip = new JButton("clip image");
            clip.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    clipImage();
            JPanel panel = new JPanel();
            panel.add(clipBox);
            panel.add(clip);
            return panel;
        public static void main(String[] args) throws IOException
             File file = new File("src/ABWRACK_4C.jpg");
             // Find a JPEG reader which supports reading Rasters.
            Iterator readers = ImageIO.getImageReadersByFormatName("JPEG");
            ImageReader reader = null;
            while(readers.hasNext()) {
                reader = (ImageReader)readers.next();
                if(reader.canReadRaster()) {
                    break;
         // Set the input.
            ImageInputStream input =
                ImageIO.createImageInputStream(file);
            reader.setInput(input);
            Raster raster = reader.readRaster(0, null);
             BufferedImage bi = new BufferedImage(raster.getWidth(),
                    raster.getHeight(),
                    BufferedImage.TYPE_4BYTE_ABGR);
             // Set the image data.
             bi.getRaster().setRect(raster);
            // Cropping test = new Cropping(ImageIO.read(file));
             CroppingRaster test = new CroppingRaster(bi);
            ClipMoverRaster mover = new ClipMoverRaster(test);
            test.addMouseListener(mover);
            test.addMouseMotionListener(mover);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(new JScrollPane(test));
            f.getContentPane().add(test.getUIPanel(), "South");
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    class ClipMoverRaster extends MouseInputAdapter
        CroppingRaster cropping;
        Point offset;
        boolean dragging;
        public ClipMoverRaster(CroppingRaster c)
            cropping = c;
            offset = new Point();
            dragging = false;
        public void mousePressed(MouseEvent e)
            Point p = e.getPoint();
            if(cropping.clip.contains(p))
                offset.x = p.x - cropping.clip.x;
                offset.y = p.y - cropping.clip.y;
                dragging = true;
        public void mouseReleased(MouseEvent e)
            dragging = false;
        public void mouseDragged(MouseEvent e)
            if(dragging)
                int x = e.getX() - offset.x;
                int y = e.getY() - offset.y;
                cropping.setClip(x, y);
    }

    The loading process It takes about 10 seconds, and every repaint it takes the same time.The painting yes, the loading no. It shouldn't take much more time to load the image then an ordinary JPEG. In particular, your now using a "natively accelerated" JPEG image reader, so it should take less time on average to load any JPEG. 10 seconds is absurd. Are you sure your not including the drawing time in that figure?
    - Another problem: JAI-ImageIO is not available for MAC OS X platform.This is somewhat true. You can take the imageio.jar file and package it together with your program (adding it to the class path). This will give you most of the functionality of JAI-ImageIO; in particular the TIFFImageReader. You just won't be able to use the two natively accelerated ImageReaders that comes with installing.
    Right now, you're using the accelerated CLibJPEGImageReader to read the image. You can't use this image reader on the MAC, so you have to take the approach mentioned in the 2nd bug report you originally posted (i.e. use an arbitrary CMYK profile).
    The conversion is too long more than 30 seconds.The code you posted could be simplified to
    BufferedImage rgbImage = new BufferedImage(w,h,
                BufferedImage.3_BYTE_BGR);
    ColorConvertOp op = new ColorConvertOp(null);
    op.filter(cmykImage,rgbImage);But again, 30 seconds is an absurd value. After a little preparation, converting from one ICC_Profile to another is essentially a look up operation. What does,
    System.out.println(cmykImage.getColorModel().getColorSpace());print out? If it's not an instance of ICC_ColorSpace, then I can understand the 30 seconds. If it is, then something is dreadfully wrong.
    the RGB bufferedImage that i get after the transformation when it is displayed is much more brightThis is the "one last problem that pops up" that I hinted at. It's because some gamma correction is going on in the background. I have a solution, but it's programming to the implementation of the ColorConvertOp class and not the API. So I'm not sure about its portability between java versions or OS's.
    import javax.swing.*;
    import java.awt.color.ICC_ColorSpace;
    import java.awt.color.ICC_Profile;
    import java.awt.image.BufferedImage;
    import java.awt.image.ColorConvertOp;
    import javax.imageio.ImageIO;
    import java.io.File;
    public class CMYKTest {
         public static void main(String[] args) throws Exception{
            long beginStamp, endStamp;
            //load image
            beginStamp = System.currentTimeMillis();
            BufferedImage img = ImageIO.read(/*cmyk image file*/);
            endStamp = System.currentTimeMillis();
            System.out.println("Time to load image: " + (endStamp-beginStamp));
            //color convert
            BufferedImage dest = new BufferedImage(img.getWidth(),
                                                   img.getHeight(),
                                                   BufferedImage.TYPE_3BYTE_BGR);
            beginStamp = System.currentTimeMillis();
            sophisticatedColorConvert(img,dest);
            endStamp = System.currentTimeMillis();
            System.out.println("Time to color convert: " + (endStamp-beginStamp));
            //display
            JFrame frame = new JFrame();
            frame.setContentPane(new JScrollPane(new JLabel(new ImageIcon(dest))));
            frame.setSize(500,500);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);
        public static BufferedImage sophisticatedColorConvert(BufferedImage src,
                                                              BufferedImage dst) {
            ICC_ColorSpace srcCS =
                    (ICC_ColorSpace) src.getColorModel().getColorSpace();
            ICC_Profile srcProf = srcCS.getProfile();
            byte[] header = srcProf.getData(ICC_Profile.icSigHead);
            intToBigEndian(ICC_Profile.icSigInputClass,header,12);
            srcProf.setData(ICC_Profile.icSigHead,header);
            ColorConvertOp op = new ColorConvertOp(null);
            return op.filter(src, dst);
        private static void intToBigEndian(int value, byte[] array, int index) {
                array[index]   = (byte) (value >> 24);
                array[index+1] = (byte) (value >> 16);
                array[index+2] = (byte) (value >>  8);
                array[index+3] = (byte) (value);
    }

  • Problem with display an image on JFrame in Java 6

    I'm trying to display an image on JFrame in this way:
    1.) I'm creating a variable in the class:
        private Image imgSpeaker = null;2.) I'm overiting the paint method:
    public void paint(Graphics g) {
            super.paint(g);   
            g.drawImage(imgSpeaker, 330, 230, null);  
        }3.) In the constructor I'm using this code:
       imgSpeaker = Toolkit.getDefaultToolkit().getImage("D:\\speaker.gif");
            MediaTracker trop = new MediaTracker(this);
            trop.addImage(imgSpeaker,0);
            try {
                trop.waitForID(0);    // waiting untill downloading progress will be complite
            } catch (Exception e) {
                System.err.println(e);
            }        The Image will be displayed on form, but if I catch the window and move it (for example: down as possible)
    the image is not refreshed (repainted). What I'm doing wrong? I've been used this solution in Java 5 and everything
    works perfectly. Any of described methods aren't depricated... Anyone can help me?

    Thanks for your code, I've been tryed to apply your solution (with create a Buffered Image), but it still not working correctly. Firstly, the image isn't loading, and secondly the basic problem is not give in. Why have you been using "bg2d.draw(img, x, y, w, h, frame);" not in the paint method?
    I'm use "Free Design" layout. Below I put on completly code from Netbeans.
    import java.awt.Graphics;
    import java.awt.Image;
    import java.awt.MediaTracker;
    import java.awt.image.BufferedImage;
    public class ImageTest extends javax.swing.JFrame {
        private Image imgSpeaker = null;
        private BufferedImage bi = null;
        private MediaTracker trop = null;
        public ImageTest() { 
                initComponents();
                trop = new java.awt.MediaTracker(this);
                imgSpeaker = java.awt.Toolkit.getDefaultToolkit().getImage("D:\\speaker.gif");
                try {
                    trop.addImage(imgSpeaker, 0);
                    trop.waitForID(0);
                } catch (java.lang.Exception e) {
                    java.lang.System.err.println(e);
                bi = new java.awt.image.BufferedImage(100, 100, java.awt.image.BufferedImage.TYPE_INT_RGB);
                java.awt.Graphics2D bg2d = (java.awt.Graphics2D) bi.createGraphics();
                trop.addImage(bi, 1);
    //            java.io.File f = new java.io.File("D:\\speaker.gif");
    //            try {
    //                bi = javax.imageio.ImageIO.read(f);
    //            } catch (IOException e) {
    //               java.lang.System.err.println(e);
        public void paint(Graphics g) {
    //      super.paint(g);
           try {                                                   
                trop.waitForAll();                                 
            } catch (Exception e) {
                System.err.println(e);
            g.drawImage(bi, 50, 100, imgSpeaker.getHeight(this), imgSpeaker.getHeight(this), this);
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
        private void initComponents() {
            jButton1 = new javax.swing.JButton();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            jButton1.setText("jButton1");
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                    .addContainerGap(283, Short.MAX_VALUE)
                    .addComponent(jButton1)
                    .addGap(44, 44, 44))
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                    .addContainerGap(252, Short.MAX_VALUE)
                    .addComponent(jButton1)
                    .addGap(25, 25, 25))
            pack();
        }// </editor-fold>
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new ImageTest().setVisible(true);
        private javax.swing.JButton jButton1;
    }

Maybe you are looking for

  • Installing Windows 7 one Mac Pro with SL RAID0, and 1 extra drive 4 windows

    So i have snow leopard installed on a RAID 0. I also have a single remaining hdd that has my old Leopard on it. I want to install windows 7 on that remaining internal hdd but bootcamp won't allow me to run setup because it says it doesn't support RAI

  • MS Word docs with Right Facing Arrows print as Left Facing on top of next word

    Printer:  M830 Multifunction printer/copier. Computer OS:  Win7 Driver:   Both the PCL & PS versions of HP Universal Printing v5.9.0                            -- HP Universal Printing PCL 6 (v5.9.0)                            -- HP Universal Printin

  • Robo freezes when opening or importing

    I cannot open projects or import files or images in RoboHelp. I can open existing projects in Windows Explorer, but I cannot open them via File > Open, or by clicking Open...on the splash screen. I am trying to create a new project, but cannot import

  • Rating in user tracker

    The ratings shown in the user tracking view (search message for this user) seem to show the ratings of the thread. IMO it would be more sensible to show the rating for the user's post, wouldn't it? Cheers,     Carsten Message Edited by cs42 on 02-08-

  • Anyone tried the new ARD Client just released today (2-1-2012)

    Has anyone tried installing and running the new ARD Client released today, Feb. 1, 2012?  The info provided by Apple about this update seems to be kind of thin in exactly what was changed.3.5.2,  It lists only screen sharing and controlling a compute