Get graphics of JTextPane and write into image

Hi!
i want to get graphics of textpane including images ,text position font and every thing in it and desiring to write in an image text should be in same alignment too.

I'd try as follows:
1. Create a BufferedImage.
2. Pass the graphics object of this BufferedImage to the paint() method of the respective text pane.

Similar Messages

  • How to get sql query data and write into csv file?

    I am writing to seek help, in how can I create bat. script which can execute the following logic:
    connection to the database
    run sql query
    create CSV file
    output query data, into CSV file
    save the CSV file
    osql
    -S 84.18.111.111
    -U adw
    -P rem
    -i "c:\query.sql"
    send ""
    sed -e 's/,\s\+/,/g' MCI_04Dec2014.csv > localNoSpaces.csv
    -o "c:\MCI_04Dec2014.csv"
    This what i have so far, and I am little struggling with the logic after creating CSV file. I am unable to get the above script to work, please advice further, where I may be going wrong. 
    Can you create if statement logic within window's script, to check for null parameters or data feeds?
    Any hints would be most appreciated. 

    Thank you for your reply. 
    Apology for posting the code irrelevant to the forum, as I am still novice scripting user.  
    My goal is to create window's script which can compute the above logic and send the final output file (csv), to FTP folder. 
    Can this logic be implemented via bat. script, if so, is there a example or tutorial i could follow, in order to achieve my task. 
    Any help would be much appreciated. 

  • How to read from one file and write into another file?

    Hi,
    I am trying to read a File and write into another file.This is the code that i am using.But what happens is last line is only getting written..How to resolve this.the code is as follows,
    public String get() {
         FileReader fr;
         try {
              fr = new FileReader(f);
              String str;
              BufferedReader br = new BufferedReader(fr);
              try {
                   while((str= br.readLine())!=null){
                   generate=str;     
              } catch (IOException e1) {
                   e1.printStackTrace();
              } }catch (FileNotFoundException e) {
                   e.printStackTrace();
         return generate;
    where generate is a string declared globally.
    how to go about it?
    Thanks for your reply in advance

    If you want to copy files as fast as possible, without processing them (as the DOS "copy" or the Unix "cp" command), you can try the java.nio.channels package.
    import java.nio.*;
    import java.nio.channels.*;
    import java.io.*;
    import java.util.*;
    import java.text.*;
    class Kopy {
         * @param args [0] = source filename
         *        args [1] = destination filename
        public static void main(String[] args) throws Exception {
            if (args.length != 2) {
                System.err.println ("Syntax: java -cp . Kopy source destination");
                System.exit(1);
            File in = new File(args[0]);
            long fileLength = in.length();
            long t = System.currentTimeMillis();
            FileInputStream fis = new FileInputStream (in);
            FileOutputStream fos = new FileOutputStream (args[1]);
            FileChannel fci = fis.getChannel();
            FileChannel fco = fos.getChannel();
            fco.transferFrom(fci, 0, fileLength);
            fis.close();
            fos.close();
            t = System.currentTimeMillis() - t;
            NumberFormat nf = new DecimalFormat("#,##0.00");
            System.out.print (nf.format(fileLength/1024.0) + "kB copied");
            if (t > 0) {
                System.out.println (" in " + t + "ms: " + nf.format(fileLength / 1.024 / t) + " kB/s");
    }

  • How to read from and write into the same file from multiple threads?

    I need to read from and write into a same file multiple threads.
    How can we do that without any data contamination.
    Can u please provide coding for this type of task.
    Thanks in advance.

    Assuming you are using RandomAccessFile, you can use the locking functionality in the Java NIO library to lock sections of a file that you are reading/writing from each thread (or process).
    If you can't use NIO, and all your threads are in the same application, you can create your own in-process locking mechanism that each thread uses prior to accessing the file. That would take some development, and the OS already has the capability, so using NIO is the best way to go if you can use JDK 1.4 or higher.
    - K
    I need to read from and write into a same file
    multiple threads.
    How can we do that without any data contamination.
    Can u please provide coding for this type of task.
    Thanks in advance.

  • Read data from Excel and write into oracle database

    Hi
    I want  to know how can i read data from excel and write into oracle database using java.Kindly help me out to find a solution.
    Thanks and Regards
    Neeta

    Hai,
    I am suggesting the solution.
    I will try out and let u know soon.
    Make a coma separated file from your excel file.
    Assuming that your requirement allows to make a csv file.
    This file may be passed as an file object to be read by java.Using JDBC you must be able to populate the data base.You can also use String Tokenizer if needed.
    You do not want to  go via sql Loader?
    For reading the excel file itself do you want java?

  • HT2963 I have a 1 TG external drive that is formatted to Windows NTFS and is read only, how do i get it to read and write on my Mac OS X 10.6.3?

    I I have a 1 TG external drive that is formatted to Windows NTFS and is read only, how do i get it to read and write on my Mac OS X 10.6.3?

    Install software such as Paragon NTFS, or reformat it as Mac OS Extended (Journaled) or FAT32. Mac OS X 10.6.5 and newer can also read and write exFAT partitions.
    (97498)

  • JTextPane and inserting/deleting image

    Hi,
    I have problems with my jtextpane. I am usign jtextpane do make simple richeditor.
    I can insert image, and no problem with inserting
    But after that, where content of jtextpane is saved and opened again, image is not able to delete...
    If is there any solution?
    Sorry for my broken English.

    Hi everyone,
    Does the image get saved when you serialize the document?
    What are you doing to serialize the document by using xml or by serializing it as an object or by using the rtf kit
    Richard West

  • How to create new Sheet in Excel file and write into it

    Hi to all, my requirement is this:
    I have an excel file (.xls) with multiple sheets (three sheets for precision: sheet1, sheet2 and sheet3).
    I must create in the same excel file new sheet, say sheet4, read data from sheet1, sheet2 and sheet3 and write them into sheet4.
    How to realize this in SSIS?
    Expecially, Is it possible to realize this in SSIS?
    thanks in advance.

    You need to create the sheet with the required metadata. There's no use creating blank sheet.
    Also metadata has to be fixed using a sample sheet prior to start of the package for setting the mapping. You may create a excel template for this purpose to just set the mapping at design time.
    At runtime pass actual excel sheet path for ExcelFilePath property of the source to point to correct file.
    Also the create table statement should include the same metadata info (columns)
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
    Hi, well it works fine! I have used a sample sheet prior to start of the package for setting the mapping.
    Next at run time  pass actual excel sheet path for ExcelFilePath property of the source to point to correct file.
    However I have set also ValidateExternalMetadata properties of the Excel Destination to false and DelayValidation properties of the package to true.
    Now my problem is the following:
    I stored the three sheets name (sheet1, sheet2, sheet3) in the Object type user variable through a script task and the foreach loop loops through the three sheets stored in the variable.
    Now, I want that at each iteration the CURRENT VALUE of the Object type user variable is mapped into another user variable wich in turn is given in input to the Excel Source.
    Resuming:
    -) I have to copy the content of three sheets (sheet1, sheet2, sheet3) of excel file into another new sheet,   sheet4.
    -) I stored the three sheets name (sheet1, sheet2, sheet3) in the Object type user variable.
    -) With a  foreach loop container I loops the three sheets stored in the Object type user variable.
    -) Within a foreach loop container I have a Data Flow Task that transfer data from source sheet (sheet1, sheet2, sheet3) into destination sheet, sheet4.
    -) PROBLEM: how to change dinamically at each iteration of the foreach loop the name of source sheet? In the destination excel Task the sheet is always the same at each iteration, sheet4. But in the source excel task the name of sheet musts change at each
    iteration. In particular at the first iteration the name of the source sheet must be "sheet1$", at the second iteration "sheet2$", in the last iteration "sheet3$".
    How to change sheet name dinamically at each iteration?
    thanks.

  • How to read XML file and write into another XML file

    Hi all, I am new to JAVAXML.
    My problem is I have to read one XML file and take some Nodes from that and write these nodes into another XML file...
    I solved, how to read XML file
    But I don't know how to Write nodes into another XML.
    Can anyone help in this???
    Thanks in advance..

    This was answered a bit ago. There was a thread called "XML Mergine" that started on Sept 14th. It has a lot of information about what it takes to copy nodes from one XML Document object into another.
    Dave Patterson

  • Get mails from server and put into DB without allocating memory.

    Hi all
    I have a application that downloads the mails from the mail server and then write them to the DB.
    I am using folder.getMessage method to get the mails from server.
    is there a way using which I can have a function that acts as a pipe between my server and DB and write the mails without consuming the memory.
    (may be something to do with getInputByteStream/getOutputByteStream or getInputStream and setBinaryStream 'preparedStatement interface ')
    Thanks

    Hi all
    I have a application that downloads the mails from the mail server and then write them to the DB.
    I am using folder.getMessage method to get the mails from server.
    is there a way using which I can have a function that acts as a pipe between my server and DB and write the mails without consuming the memory.
    (may be something to do with getInputByteStream/getOutputByteStream or getInputStream and setBinaryStream 'preparedStatement interface ')
    Thanks

  • Reading Data from Unix file and write into an Internal table

    Dear all,
                     I am having an requirement of reading data from unix file and write the same into an internal table..how to do that ...experts please help me in this regard.

    Hi,
    do like this
    PARAMETERS: p_unix LIKE rlgrap-filename OBLIGATORY.
    DATA: v_buffer(2047) TYPE c.
    DATA: BEGIN OF i_buffer OCCURS 0,
            line(2047) TYPE c,
    END OF i_buffer.
    * Open the unix file..
    OPEN DATASET p_unix FOR INPUT IN TEXT MODE.
    <b>IF sy-subrc NE 0.
    *** Error Message "Unable to open file.
    ELSE.</b>
       DO.
         CLEAR: v_buffer.
         READ DATASET p_unix INTO v_buffer.
         IF sy-subrc NE 0.
            EXIT.
         ENDIF.
         MOVE v_buffer TO i_buffer.
         APPEND i_buffer.
      ENDDO.
    ENDIF.
    CLOSE DATASET p_unix.
    <b>Reward points if it helps,</b>
    Satish

  • I used "Get Waveform Components" to separate waveform data. I need to get the time stamp and write it on file as an header.

    I am not able to solve the problem because I can't find an I/O vi that writes on file time stamp data. An error occurs, because of connecting different data types. How can I convert time stamp data so that I can use it as input in a write on file vi? Please, help me!

    The problem with the selection seems to be that you are using two different indexing tunnels on the for loop. One of them loops over every value of the first incoming waveform, the other one over all waveforms in the incoming array. The value you wire to the N terminal will be ignored, the number of loop executions will be the minimum of your indexes. Anyway, the loop doesn't seem to do what you wanted:
    - If you want to store the complete waveform: loop over all waveforms, check for the maximum of each of them and write it just like you do now.
    - If you want to store only the values of each waveform that actually exceeded the threshold: You can either use 2 nested for loops to iterate over each value of each waveform. Use shift registers t
    o create new arrays of timestamps / values for the values you want to store. You need to either convert the waveform to x-y-pairs (VI on analog waveform palette) or calculate your own timestamps. You might as well want to check out the "Search waveform" VI. Configure it so that value+-tolerance covers the band between your expected minimum value and your threshold value. The VI will give you the indices and timestamps of all fits.

  • How to read the data file and write into the same file without a temp table

    Hi,
    I have a requirement as below:
    We are running lockbox process for several business, but for a few businesses we have requirement where in we receive a flat file in different format other than how the transmission format is defined.
    This is a 10.7 to 11.10 migration. In 10.7 the users are using a custom table into which they are first loading the raw data and writing a pl/sql validation on that and loading it into a new flat file and then running the lockbox process.
    But in 11.10 we want to restrict using temp table how can we achieve this.
    Can we read the file first and then do validations accordingly and then write to the same file and process the lockbox.
    Any inputs are highly appreciated.
    Thanks & Regards,
    Lakshmi Kalyan Vara Prasad.

    Hello Gurus,
    Let me tell you about my requirement clearly with an example.
    Problem:
    i am receiving a dat file from bank in below format
    105A371273020563007 07030415509174REF3178503 001367423860020015E129045
    in this detail 1 record starting from 38th character to next 15 characters is merchant reference number
    REF3178503 --- REF denotes it as Sales Order
    ACC denotes it as Customer No
    INV denotes it as Transaction Number
    based on this 15 characters......my validation comes.
    If i see REF i need to pick that complete record and then fill that record with the SO details as per my system and then submit the file for lockbox processing.
    In 10.7 they created a temporary table into which they are loading the data using a control file....once the data is loaded into the temporary table then they are doing a validation and updating the record exactly as required and then creating one another file and then submitting the file for lockbox processing.
    Where as in 11.10 they want to bypass these temporary tables and writing it into a different file.
    Can this be handled by writing a pl/sql procedure ??
    My findings:
    May be i am wrong.......but i think .......if we first get the data into ar_payments_interface_all table and then do the validations and then complete the lockbox process may help.
    Any suggestions from Oracle GURUS is highly appreciated.
    Thanks & Regards,
    Lakshmi Kalyan Vara Prasad.

  • Getting Ripped DVD Video and Audio Into Encore

    Do you have previously authored DVDs that need rework?  Do you want to add menus with greater impact and functionality?  Do you want to add some additional program or supplemental material?  Does a client want their product demo DVD to be updated to reflect the capabilities of the new and improved version, but the source files no longer exist?  Using Adobe Encore DVD and a freeware utility called DVD Decrypter (DVDD), you can accomplish this quickly and easily.
    Disclaimer: I do not support the illegal copying and/or distribution of copyrighted works.  The authors and distributors of the software I use have made it clear that they do not support illegal copying.  This guide is intended solely to assist you in ripping and copying DVD video to which you have the legal rights.  Any use of this guide to infringe the copyright of someone else’s intellectual property is prohibited.
    This guide is based on Adobe Encore DVD 1.5.1 and DVD Decrypter version 3.5.4.0.  Let’s Begin!
    Place the DVD to be ripped in your DVD drive and launch DVDD.  If you have more than one drive (e.g., a DVD-ROM and a DVD burner) make sure the one with the disc is selected in the Source dropdown list in the main program window.  Now we need to set up DVDD to extract video in a way that is “Encore friendly”.  This is the toughest part of the whole exercise.  Click on the Tools menu item and choose “Settings…”. 
    Settings
    General Tab: You can leave these set at their defaults if you like.  Personally, I specify a custom Default Destination.  I put my ripped video assets all in one place anyway, and having a default destination means I have one less thing to do when I rip a DVD.
    IFO Mode Tab: Make sure that “Select Main Movie PGC” and “Enable Stream Processing” are checked.  “Uncheck Suspect Cells” is probably a good default safety check.  If your hard disks are formatted as NTFS, set File Splitting to “None”.  I leave “Copy IFO File” checked with the default sub-items checked.  Make sure that “Patch M2V Timecode” is unchecked.  The items in the Create Additional Files section are purely optional.  The author of DVDD has been kind enough to list which programs need which files; notice that Encore DVD isn’t listed as needing any of these extra files.  I do keep the “Stream Information” box checked.  DVDD generates very informative file names, but I like to keep “Include PGC Number” under File Names checked.  Be advised you will get some lengthy file names after DVDD is finished ripping.
    Stream Processing Tab: Since we enabled stream processing in the IFO Mode tab, we need to tell DVDD how to process those streams.  To save yourself time and confusion later, check the “Convert PCM to WAV” box.  Earlier versions of Encore required a Demuxed audio stream and a Raw video stream.  Encore 1.5.1 can accept either type of video stream (Raw or Demuxed) but it does still require a Demuxed audio stream.  However, I still recommend using Raw video and Demuxed audio, if only because it seems to be somewhat faster to process in DVDD.  This workflow is also backward-compatible with earlier versions of Encore.
    So let’s set up the Stream Processing tab now.  In the Demux box, enter “0x8? 0xA? 0xC?”.  This ensures that all audio streams in the selected PGC, whether AC3, PCM or MPEG will be set to Demux.  In the Raw box, enter “0xE0”.  This ensures that the video from the selected PGC will be set to Raw.  
    Additional Notes about the Stream Processing Tab:
    1. For those of you asking the question, “What the heck is a PGC?” it’s just DVD-speak for the titles in a DVD project.  And I’m not talking about the opening or end credits, either; I’m talking about the titles that result, for example, from the timelines you create in an Encore DVD project.  There is a subtle difference between a PGC and a VTS (title set), but that's not important right now.
    2. Happily, recent versions of DVDD create a WAV file after ripping that will import directly into Encore.  Versions prior to 3.2.0.0 would create a WAV file that had to be imported to, and exported from, a sound editing program like Adobe Audition, Goldwave or SoundForge before Encore would recognize it.
    Events Tab: For convenience sake, I recommend setting “Set Program Mode” in the Startup section to “IFO”.  That way, whenever you launch DVDD, it will look familiar to you.  You may safely ignore all of the other tabs in the Settings dialog. 
    Ripping
    1.Under the Input Tab of the main program window, select the PGC you want to rip.  You can only do one at a time.
    2.Switch to the Stream Processing Tab.  Verify that Enable Stream Processing is checked.
    3.Check or uncheck any or all of the video and audio streams that are listed.  Highlight each one to verify that all audio streams are set to Demux and the video stream is set to Raw.
    4.If you didn’t select Default Destination in the General Settings Tab, then you need to tell DVDD where to put the ripped files now.
    5.Click on the big DVD-to-Disk icon.
    6.DVDD will announce, quite loudly, when it has finished.  At that point you can rename the files or import them as is into Encore.
    I hope you find this guide useful and that it helps you get the most out of your investment in Adobe Encore DVD.
    Guide © Jeff Bellune 2005

    OK, I can't tell you what we are doing, you'll have to trust me that it's for a very good cause. I'll simplify the use case as an example. If I can do the following we'll be OK:
    1) Read video/audo files from a DVD that we created
    2) Open these files with the QuickTime Player, click on Export to Apple TV to create an output file.
    I'd rather not do an interim conversion of the video data (like use a 3rd party app to convert to mp4 first and then read into QT, but I'm considering a conversion to DV) because that could seriously hurt the apps effectiveness. I also can't use another app (MPEG Streamclip, HandBrake, VisualHub, etc.) to do the conversion.

  • Read and write into csv file using procedure

    I would like to read a particular column value from csv file(which will have many columns) using procedure and for that value I have to retrieve some more values from database table and have to append into same csv file.
    can someone help me?
    Thanks
    Edited by: 1002478 on Apr 25, 2013 5:52 AM
    Edited by: 1002478 on Apr 25, 2013 5:55 AM

    1002478 wrote:
    thanks for your reply.
    Using UTL_FILE i'm able to read csv file. I'm stuck up in appending some more columns to same csvYou'll struggle to append data to an existing CSV.
    You'd be better to read the data from one CSV, and create another CSV using that data, and the extra data you want, and then when finished, delete the original file and rename the new file to the old filename.
    You should be able to do that using External Tables to read the source file (easier than using UTL_FILE) and UTL_FILE to write the new file.

Maybe you are looking for