Cant write an image contained object to a file

HI, I am trying to save Vector object to a file which contains an image as one element.But i am not able to do that can anybody tell how to write the program.
i wrote the following program to do that task. but it's not working
can anybody tell what changes i have to make my program to work properly
my code as follows
import java.util.*;
import java.io.*;
import java.awt.*;
class ImageWrit implements Serializable
Image img;
public ImageWrit(){
img= Toolkit.getDefaultToolkit().getImage("a9.bmp");
class A{
public static void main(String s[])
FileOutputStream fout;
ObjectOutputStream out ;
Vector list = new Vector();
list.add(new ImageWrit());
try{
fout = new FileOutputStream("a.txt");
out = new ObjectOutputStream(fout);
out.writeObject(list);
System.out.println("object is saved");
catch(Exception e)
System.out.println("error");
}

It's easier to read your code (and help) when you use the code tags in you message...
it's also helpfull to know why you are not able to do it, compiler error, or runtime error, or...
third it's best to show a StackTrace in case of an Exception, like thatcatch(Exception e)
    System.out.println("error"); // this tell nothing about the Exception
    e.printStackTrace();
}Maybe your problem is that the Image returned by ToolKit is not Serializable, you can search the internet for something like "java serializable image" for some hints... like making an ImageIcon of the image, which will be Serializable
    public ImageWrit() {
        img = new ImageIcon(Toolkit.getDefaultToolkit().getImage("a9.bmp"));
    }(also have a look at javax.imageio.ImageIO)

Similar Messages

  • How to view the content (contained objects) of transport files without importing?

    Hi,
    we do often receive transport files (DATA and CODILE) from third parties.
    If is is done correctly the supplier of the transport files devliver also additional information about the detailed content of the transport, e.g object lists as plain text file, so that we are informed which objekts will be imported in advance.
    But some suppliers don't. Or we want only check, if additional info and real transport content match.
    So for that reason  I am looking for a possible way to view the object list of such transports without adding it to the import queue or importing it to a sandbox system or even add it to the import buffer..
    Most likely this should be done by a standalone tool (on Windows) or a tool running on SAP accessing the transportfiles (preference: stored only on the client PC  and not added to the transport directory)
    So my question is: Is there any tool that can extract the object list from the transport files and display it?
    Helst regards
    Helmut Fischer

    Helmut,
    If you don't have access to the server console, it might be possible to 'trick' tp into working from a workstation, but I wouldn't bet on it. You'd have to fake up a profile for it. I haven't tried this.
    Peering into the contents of a delivered transport file would be something that your Basis team would typically do. My suggestion is to work with them, either to use tp command-line option from the server console, or if that's not reasonable, then yes, go ahead and add it to the import queue of one of your sandbox systems. You can always delete it from the queue again later. If you don't actually import it, it isn't going to hurt anything.
    To do any of these options is going to require some level of filesystem access to your transport host, as you need to copy the two files that make up the transport there. You need to put the 'K' file into \usr\sap\trans\cofiles and the 'R' file into \usr\sap\trans\data. Then, you can either use the tp command-line tool, or you can go into STMS, go into the import queue of any system in the transport domain (so a sandbox is fine), and use Extras... Other Requests... Add and type in the transport request ID. Yes, this adds some entries about the transport into a few tables, but it doesn't actually import the transport, and it doesn't change anything about your system. It just allows the transport to show up as importable in the queue, and that will make it so that you can read the object list of the transport. Then, if you decide not to import it, you can delete it from the queue, and your system is back to the way it was before. Also, doing this will not put the transport into any other system's queue. Even if you import the transport (into a sandbox system), it won't show up in any other system's queue until you forward it.
    Regards,
    Matt

  • Cant see the image in browser!

    Hi
    I have a jsp application where I am visiting some JPG image . I placed the image inside :
    "C:\jakarta-tomcat-5.0.25\webapps\ROOT\reports\output\proe\"
    I am able to see those image in my machine. I sent the link of my application to my supervisor. He is able to run the application but he cant view those image rather than some cross signs. Any idea why is that? .This is my first web application. Still needs to know lot of stuff. Pls help/suggest me.
    Regards

    This may be caused by a Tomcat configuration issue.
    When you say "application", do you mean web application.. Have you created a web application directory within the webapps folder or are you using the default, as your directory structure would suggest..
    You mention a jsp application.. Do you mean you have developed a jsp page which contains an image..Do you have a jsp page at CATALINA_HOME/webapps/ROOT ...
    I suggest reviewing a bit about web applications and Tomcat deployment to help you solve this issue.
    http://jakarta.apache.org/tomcat/tomcat-5.0-doc/setup.html
    http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/index.html
    http://www.coreservlets.com/Apache-Tomcat-Tutorial/

  • How can i write an image to file

    hi everybody,
    How can i write a java.awt.Image object to a file.I want to write it to file as a jpg image.Is ther any jpegencoder which can write an Image object to file.
    any tips or suggestions
    Thanks in advance

    This may be only of limited use but it shows an encoder in use.
    http://forum.java.sun.com//thread.jsp?forum=5&thread=140954
    http://forum.java.sun.com/thread.jsp?forum=48&thread=446603&tstart=0&trange=15
    rykk

  • Why should we add the components of JAppet to Container object ?

    why should we add the components of JAppet to Container object ? Because we are able to run the program by adding the components to the JApplet directly without using any container objects. Both with using and without using container to add components are giving the same outputs. So why we need to add them to container ? Thanks for all replying

    we are able to run the program by adding the components to the JApplet directly without using any container objectsSort of true. JApplet does have an add() method. And you can use that method rather than using getContentPane() and adding things to the Container it returns. But this method does not add things to the applet "directly without using any container objects".
    The [API documentation|http://java.sun.com/javase/6/docs/api/javax/swing/JApplet.html] explains: "JApplet contains a JRootPane as its only child. The contentPane should be the parent of any children of the JApplet. As a convenience add and its variants, remove and setLayout have been overridden to forward to the contentPane as necessary. This means you can write:
    {code}
    applet.add(child);
    {code}
    And the child will be added to the contentPane. The contentPane will always be non-null. Attempting to set it to null will cause the JApplet to throw an exception"

  • Scheduled task powershell script cant write file

    Hello experts
    I have scheduled task with powershell but cant write CSV file. Below my PS script:
    $ExemptGroup = Get-ADGroup app_users
    Get-ADUser -Filter { -not (memberOf -RecursiveMatch $ExemptGroup.DistinguishedName) } -Properties * |
     Select-Object -Property DisplayName,SamAccountName,WhenCreated,@{Name='Last Logon';Expression={[System.DateTime]::FromFileTime($_.LastLogon).ToString('g')}},LogonCount,@{N='Status';E={
    If ( $_.useraccountControl -match '^(?:514|546|66050|66082)$' ) { 'Disabled' } Else { 'Enabled' } }} |
     Sort-Object -Property DisplayName | Export-Csv C:\Users\22041912\Documents\User_statis_list.csv
    In Powershell my script working normally and writing CSV file but in scheduled task cant write CSV file. Task history told me succesfully finished.
    Anyone suggest? What wrong?

    copy this on a batch file and point the task scheduler to the batch file.
    PowerShell.exe -WindowStyle Hidden  -File
    E:\Shell\OdmaaGet-Aduser.ps1 
    check if it works..
    Every second counts..make use of it. Disclaimer: This posting is provided AS IS with no warranties or guarantees and confers no rights.
    IT Stuff Quick Bytes

  • Unable to write an image to excel with report generation toolkit

    I am unable to write an image to excel with the report generation toolkit. The VI works fine for word, but when I select Excel the speadsheet pens but remains blank.

    Ranjeet
    I am using Labview 2013 or 8.0, but here is an image of the very simple test VI.
    Regards
    Steve

  • XPATH - Scope of BPM container objects

    Hi,
    I have a question.
    When we declare container objects in BPM, the scope is mentioned as "Process".
    Does this mean that I can use any container objects declared within the process anywhere.
    What I am trying to do is, after a SYNC step, I have a ASYNC step. I have to use the response from the SYNC step in the ASYNC step.
    The problem is that the interface of SYNC's response differs from ASYNC's request.
    So I was wondering if I could mention the XPATH of SYNC's response while doing the receiver determination for ASYNC.
    I tried and it does not work. But technically I assume it has to work.
    Could someone point out where I am going wrong ( My understanding / Steps that I am following ).
    Thank you team.

    When you do the mapping outside of BPM (which is recommended anyway)
    then you send the sync response directly as async request and do receiver det. and mapping. to the new structure.
    when you do mapping and receiver det. inside BPM, you should be able to access all container elements, but I do not have experience with this.

  • ResultList and Container objects

    The Java ResultList and Container objects are used in SAP Mapping UDF's ...does anyone know which specific jar files contain these object definitions ?
    Thanks,
    Rod.

    For PI 7.0(3.0) you need the libraries: aii_mt_rt.jar, aii_map_api.jar, aii_utilxi_misc.jar
    For PI 7.1 you need the libraries: com.sap.xi.mapping.tool.lib_api.jar, com.sap.xpi.ib.mapping.lib.jar, com.sap.aii.utilxi.server.jar
    /people/stefan.grube/blog/2005/12/30/test-user-defined-functions-for-the-xi-graphical-mapping-tool-in-developer-studio

  • Using Container Object in Java Mapping

    Hi All,
    I need to use a Container object inside a Java Mapping, just like the one wich is used in the Graphical Mapping.
    Here is the scenario:
    I have an Interface Mapping with three steps on it.
    The first step is a Java Mapping just to put some info in the Container. The second step is a XSLT transformation that uses an XSLT file to transforms from IDOC to xCBL. The third step is another Java Mapping that get the info from the Container and insert in the xCBL.
    Does any one knows how to do it inside the Java Mapping Code? We cannot make modifications in the XSLT file because of some internal restrictions.
    Thanks,

    Hi,
    If you make the container variable is a part of your message (input of Java Mapping) then you can access as normal fields.
    Just have a look at these discussions-
    How to use Container Variable across Maps
    xi 3.0 - Using BPM variables in messages
    Hope this helps,
    Regards,
    Moorthy

  • How to add a container object in a station globals

    Hi,
    How to add a container object in a station globals

    Hi radlou,
    This might be what you're looking for:
    NewSubProperty Method
    Syntax
    PropertyObject.NewSubProperty ( lookupString, ValueType, asArray, typeNameParam, options)
    Purpose
    Creates a new subproperty with the name the lookupString parameter specifies.
    Parameters
    lookupString As String
    [In] Pass the lookup string for the new subproperty to be created. If you pass a lookup string with multiple levels (such as "x.y.z"), this method creates all of the necessary intermediate container objects. Refer to lookup string for more information about the strings you can use.
    ValueType As PropertyValueTypes
    [In] Pass the type of value you want the new subproperty to store.
    asArray As Boolean
    [In] Pass True to make the new subproperty an array whose elements are of the type you specify in valueType.
    typeNameParam As String
    [In] Pass the name of an existing type if you want to create the new subproperty as an instance of a named type. Otherwise, pass an empty string. If you pass a type name, you must pass PropValType_NamedType for the ValueType parameter. Refer to NamedPropertyTypes for a list of built-in named types.
    options As Long
    [In] Pass 0 to specify the default behavior, or pass one or more PropertyOptions constants. Use the bitwise-OR operator to specify multiple options. You do not need to pass the InsertIfMissing option to create the new subproperty. Pass DoNothingIfExists if you want the method to not report an error if the subproperty already exists.

  • Container Object in Java Class

    Hello ,
    I have a Mapping program using java class type (Java SAX in this case).  I need to access some Runtime constants and the mapping trace object.
    In message mapping is simple. We can use the container object that is pass to a UDF and the GlobalContainer Object.
    But how can I access the  Runtime constants  and mapping trace without a container object ?.
    Any ideas...?
    Thanks in advance.
    Yuvan D.

    in Your java mapping class
    you should import import com.sap.aii.mapping.api.*;
    public void execute(InputStream input, OutputStream output)
            throws StreamTransformationException {
            AbstractTrace trace = null;
            String RESULT = new String();
            trace =
                (AbstractTrace) param.get(
                    StreamTransformationConstants.MAPPING_TRACE);
    trace.addInfo(doc.toString());
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm

  • Acrobat Help | Edit images or objects in a PDF

    This question was posted in response to the following article: http://helpx.adobe.com/acrobat/using/edit-images-or-objects-pdf.html

    WHEN I ADD AN IMAGE INTO A .PDF THE GRIP HANDLES DO NOT ALLOW ME TO RESIZE THE IMAGE.
    INSTEAD I GET BLUE LINES ALONG THE SIDE THAT I CLICK ON AND THE WHOLE IMAGE MOVES WITHOUT RESIZING.
    IT WORKED PROPERLY A FEW DAYS AGO NOW I DO NOT KNOW WHAT IS WRONG.
    THANKS, PETER

  • I cant write a review in itunes store

    Why suddenly i cant write any review on any app i downloaded?it says i need to download the app before i can make a review even if i downloaded the app over and over again, cant find any solution

    You want to write a review about Mountain Lion? I'm not sure that you can write about the OS at the app store - it's not an app. Or are you talking about the online Apple store? If you want to send feedback to Apple, you could use this:
    http://www.apple.com/feedback/macosx.html

  • CFMAIL - Background Image contained in TD Not Displaying in Outlook

    A backgorund image contained in a <TD width="400" background="http://www.abcdef.com/img/background_B.jpg"> does not appear when the html email message is opened in Outlook. However, if you click the having trouble viewing this email prompt the image does display on the web view. Is this a CFMAIL problem? If so does anyone have a work around for or other ideas where to look for a solution?

    As we don't know your code, your imaging library or anything else that you are doing - and my crystal ball is on the fritz - we can't really help :(.
    However, given that you are talking about CMYK the first question is about whether you a re working on a CMYK surface or converting to RGB?  If converting, how?
    Second, what filter is applied to the image?  DCT? Flate?  Other?
    Third, are you considering any DecodeParms on the image?
    Fourth, is the image indexed or not?
    And the list goes on..

Maybe you are looking for

  • 64-bit windows, CF9 multiserver JRUN

    Hi, We are upgrading our environment.  We have successfully run ColdFusion 7 via a JRUN cluster on two Windows 2003 32-bit servers.  We are now looking to run ColdFusion 9 via a JRUN cluster on two Windows 2008 64-bit servers.  The failover is a must

  • How do I connect wirelessly to my new mac mini from my macbook pro

    Hi, I've just bought a new mac mini, its connected to my HDTV via the HDMI cable....it is showing as it should on my tv screen....but my question is: how do I connect to the mac mini via my macbook pro? I want to be able to control the mac mini wirel

  • Updating InfoType 0001 in ABAP

    Our parent company is passing different begin and end dates from Infotype 0001 to our HR system. In our system an employee would have a start date of 3/1/2005 but our parent company has the same employee in there system as a start date of 1/1/2008. I

  • Ipad will not open photos from sd card

    ipad wll not open  photos from an sd card

  • Runtime Error: java.lang.ClassCastException

    My project is to creat a postfix with boolean. I finished my code, it compiled great, than I got an java.lang.ClassCastException. So obviously I have a casting problem. Any help or hints in the right direction would be greatly appreciated.      impor