Converting swing components into some readable format

Hello all,
A requirement for the application I'm writing is for it to email automatically generated reports to various clients. My problem is that I'm not sure what would be the best format to send the reports. The reports are attached to the email and the sent via JavaMail.
I have 2 modes of thought at this stage:
1. Convert a Report (Printable Swing component) to HTML and either attach this or embed it in an email. Question here is how do I convert the Report to HTML?
2. Print the Report using Adobe Distiller. Once the pdf is created, attach it to the email and send. Problem is that it's unlikely that other users of my software have Distiller. Any Swing to PDF packages that anyone knows of?
To give you some idea of exactly what I'm doing, please look at the following 2 links.
1. A screen shot of the Report:
http://www.genepi.waimr.uwa.edu.au/radar/storage/report.jpg
2. The Report after it's been printed with Distiller:
http://www.genepi.waimr.uwa.edu.au/radar/storage/report.pdf
Note: The previous files will be removed from the server in a couple of days.
Also, I'm open to any other suggestion! So if anyone has a good idea, please post it!
Thanks,
Muel.

Thanks for your reply.No problem. Interesting problem, as a matter of fact.
Those reports are created dynamically from querying a
database. A Report itself is a JDialog, the
content-pane of which uses a custom LayoutManager.
The LayoutManager controls a Book and decides whether
or not to add JLabels to the current ReportPage (a
Printable JPanel), or to create a new ReportPage and
add them to it.This is where I don't quite agree with your approach. I don't know if you're familiar with the MVC concept because this is typically the issue you're dealing with here. I hope I'm not misinterpreting what you said but it seems you are storing the content of your database query directly in a particular View (a violation of the MVC principle).
What you need to do is create a true Model which will hold the logic of what your Reports really are. From what I understood with your image, this class should contain member variables such as addresses, a title, funny notes ;) ...
Displaying your report in a JDialog is all about creating the most appropriate View for that Model. Using a custom document with its own LayoutManager, JLabels... is, IMHO, a very pragmatic, convenient choice. It is not the only possible choice however. What if, in the future, you wanted to allow the user to copy / paste the report outside your application ? What if, you wanted to allow him/her to edit it prior to printing it?
Your other requirements involve a printable version of your report and one that can be sent by email. It turns out that HTML is a good pick. Personally, I once had to print HTML and the advices I found at http://www.fawcette.com/javapro/2002_12/online/print_kgauthier_12_10_02/ were quite precious (paging is nicely handled). Moreover, sending html in a mail is piece of cake.
All it comes down to is how to produce that HTML. Forget about my suggestion of creating a StyledDocument. It might work but writing HTML directly is much faster and easier. The only real constraint here is that the produced HTML should be 3.2 valid. In your case, this serialization should be conducted on the Model, NOT on the View.
I forgot to mention that once you'll have produced that "html report writer" class, you'll have to reconsider using a JTextPane for your Report display JDialog.

Similar Messages

  • How can I convert DVD- video into Apple's format so that it can be played and streamed from my Mac?

    How can I convert DVD- video into Apple's format so that I can play the content on my Mac and also stream it to my Apple TV? A few years ago, I transferred all of my home videos onto DVD but now would really like to put these onto my Mac and stream them through Apple TV to watch on the "big screen". Any advice would be most welcome!! Thanks

    MPEG Streamclip.
    Apple do not have their "own" format. You need to convert your DVDs to H.264 though.

  • I have just subscribed to Adobe Export and my debit card has been charged but I cannot convert a pdf into a word format on my mac.  Does it take time to process?  I have purchased the package about thirty minutes ago?

    I have just subscribed to Adobe Export and my debit card has been charged but I cannot convert a pdf into a word format on my mac.  Does it take time to process?

    Hi nickel13,
    What is the problem you are facing?
    Is this happening with a single PDF file?
    Regards,
    Florence

  • Convert XML string into an abap format date and time

    Hi,
    Does anyone know of a method or a function module in ABAP which converts XML string into an abap format date and time.
    Here is a part of the xml that I want to convert.
    <ns2:EventDateTime>2009-07-02T10:13:45+10:00</ns2:EventDateTime>
    <ns2:EventMessageTransmissionDateTime>2009-07-02T10:13:45.987+10:00</ns2:EventMessageTransmissionDateTime>
    Currently EventDateTime and EventMessageTransmissionDateTime are type XSDDATETIME_Z and these are converted to proper dates and times. We will be changing these fields to a STRING instead of XSDDATETIME_Z. The reason for this is to make the field more versatile. The customer would be receiving dates with Zulu (2009-09-23T12:00:00Z), with offsets (2009-09-23T12:00:00+10:00/-10:00) and just local timestamp (2009-09-23T12:00:00). With this, we need to make the date fields as string
    to be able to accept the various date formats (esp. the local timestamp).
    I am looking for a standard function module or method that will convert the xml string to a proper date and time abap format.
    Would appreciate anyone's help!
    Thanks.
    Edited by: eunice ocson on Jul 13, 2009 1:49 AM
    Edited by: eunice ocson on Jul 13, 2009 1:50 AM
    Edited by: eunice ocson on Jul 13, 2009 1:51 AM
    Edited by: eunice ocson on Jul 13, 2009 1:51 AM

    Hi Eunice
    Use the FM 'SMUM_XML_PARSE'
    for more info
    [Convert XML string to ABAP|XML String to ABAP or GUI]
    hope it helps you.
    Thanks!!

  • Converting spool ouput into ms word format

    Dear experts,
    I need to convert a spool request into MS WORD format.
    Can any one show me the right way to do this ?
    With Regards
    Ravishankar Vembu.

    Unfortunately SAP only provide ASCII and PDF conversion from OTF. (look CONVERT_OTF)
    You may check the function module
    CALL FUNCTION 'RSPO_DOWNLOAD_SPOOLJOB'
         EXPORTING
              id    =  id " spool id
              fname = fname " filename with .doc
    But some formatting will be loss.
    Regards

  • Report for converting the documents into the PDF format.

    Hello Experts,
    I need to know if any report/ T-code is available in SAP to convert the files into  PDF format.
    We are processsong these PDF's then into IXOS system.
    Regards,
    Anna.

    Hello ,
    You may check with the below programs:
    Program name                   Report title
    RSTXCPDF                       Routines for Converting OTF Format to PDF Format
    RSTXPDF2                       Administration/Upload of type 1 and TrueType font files
    RSTXPDF3                       Customizing for OTF-PDF Conversion
    RSTXPDF4                       Help Report from CONVERT_OTFSPOOLJOB_2_PDF
    RSTXPDF5                       Help Report from CONVERT_ABAPSPOOLJOB_2_PDF
    RSTXPDFT                       Test report for PDF conversion - converting standard texts to PDF
    RSTXPDFT2
    RSTXPDFT3                      Test
    RSTXPDFT4                      Convert SAPscript (OTF) or ABAP Lists Spool Job by PDF
    RSTXPDFT5                      Test: GUI Download of Spool Request
    Regards
    Ramesh Ch

  • How can I convert table object into table record format?

    I need to write a store procedure to convert table object into table record. The stored procedure will have a table object IN and then pass the data into another stored procedure with a table record IN. Data passed in may contain more than one record in the table object. Is there any example I can take a look? Thanks.

    I'm afraid it's a bit labourious but here's an example.
    I think it's a good idea to work with SQL objects rather than PL/SQL nested tables.
    SQL> CREATE OR REPLACE TYPE emp_t AS OBJECT
      2      (eno NUMBER(4)
      3      , ename  VARCHAR2(10)
      4      , job VARCHAR2(9)
      5      , mgr  NUMBER(4)
      6      , hiredate  DATE
      7      , sal  NUMBER(7,2)
      8      , comm  NUMBER(7,2)
      9      , deptno  NUMBER(2));
    10  /
    Type created.
    SQL> CREATE OR REPLACE TYPE staff_nt AS TABLE OF emp_t
      2  /
    Type created.
    SQL> Now we've got some Types let's use them. I've only implemented this as one public procedure but you can see the principles in action.
    SQL> CREATE OR REPLACE PACKAGE emp_utils AS
      2      TYPE EmpCurTyp IS REF CURSOR RETURN emp%ROWTYPE;
      3      PROCEDURE pop_emp (p_emps in staff_nt);
      4  END  emp_utils;
      5  /
    Package created.
    SQL> CREATE OR REPLACE PACKAGE BODY emp_utils AS
      2      FUNCTION emp_obj_to_rows (p_emps IN staff_nt) RETURN EmpCurTyp IS
      3          rc EmpCurTyp;
      4      BEGIN
      5          OPEN rc FOR SELECT * FROM TABLE( CAST ( p_emps AS staff_nt ));
      6          RETURN rc;
      7      END  emp_obj_to_rows;
      8      PROCEDURE pop_emp (p_emps in staff_nt) is
      9          e_rec emp%ROWTYPE;
    10          l_emps EmpCurTyp;
    11      BEGIN
    12          l_emps := emp_obj_to_rows(p_emps);
    13          FETCH l_emps INTO e_rec;
    14          LOOP
    15              EXIT WHEN l_emps%NOTFOUND;
    16              INSERT INTO emp VALUES e_rec;
    17              FETCH l_emps INTO e_rec;
    18          END LOOP;
    19          CLOSE l_emps;
    20      END pop_emp;   
    21  END;
    22  /
    Package body created.
    SQL>Looks good. Let's see it in action...
    SQL> DECLARE
      2      newbies staff_nt :=  staff_nt();
      3  BEGIN
      4      newbies.extend(2);
      5      newbies(1) := emp_t(7777, 'APC', 'CODER', 7902, sysdate, 1700, null, 40);
      6      newbies(2) := emp_t(7778, 'J RANDOM', 'HACKER', 7902, sysdate, 1800, null, 40);
      7      emp_utils.pop_emp(newbies);
      8  END;
      9  /
    PL/SQL procedure successfully completed.
    SQL> SELECT * FROM emp WHERE deptno = 40
      2  /
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM
        DEPTNO
          7777 APC        CODER           7902 17-NOV-05       1700
            40
          7778 J RANDOM   HACKER          7902 17-NOV-05       1800
            40
    SQL>     Cheers, APC

  • Converting spool request into multiple pdf formated documents

    Hi Guys,
                 I am designing a report with several pages of output and running it in background.
    Is there a possibility to convert each page into an separate pdf format document ?
    If I use ALV report as output, if its more than page, do I face any issue with pdf conversion.
    Thanks

    Check the Following code, This might be helpful:
    form rstxpdft4 using filename.
    * Read spool job contents (OTF or ABAP list) and convert
    * to PDF, download PDF
      data: download  value 'X'.
      data: lv_filename like rlgrap-filename.
      lv_filename = filename.
      data otf like itcoo occurs 100 with header line.
      data cancel.
      data pdf like tline occurs 100 with header line.
      data doctab like docs occurs 1 with header line.
      data: numbytes type i,
            arc_idx like toa_dara,
            pdfspoolid like tsp01-rqident,
            jobname like tbtcjob-jobname,
            jobcount like tbtcjob-jobcount,
            is_otf.
      data: client like tst01-dclient,
            name like tst01-dname,
            objtype like rststype-type,
            type like rststype-type.
      select single * from tsp01 where rqident = gt_rq-rqident.
      if sy-subrc <> 0.
        write: / 'Spool request does not exist', gt_rq-rqident
                color col_negative.
        exit.
      endif.
      client = tsp01-rqclient.
      name   = tsp01-rqo1name.
      call function 'RSTS_GET_ATTRIBUTES'
           exporting
                authority     = 'SP01'
                client        = client
                name          = name
                part          = 1
           importing
                type          = type
                objtype       = objtype
           exceptions
                fb_error      = 1
                fb_rsts_other = 2
                no_object     = 3
                no_permission = 4.
      if objtype(3) = 'OTF'.
        is_otf = 'X'.
      else.
        is_otf = space.
      endif.
      if is_otf = 'X'.
        call function 'CONVERT_OTFSPOOLJOB_2_PDF'
             exporting
                  src_spoolid              = gt_rq-rqident
                  no_dialog                = ' '
             importing
                  pdf_bytecount            = numbytes
                  pdf_spoolid              = pdfspoolid
                  btc_jobname              = jobname
                  btc_jobcount             = jobcount
             tables
                  pdf                      = pdf  .
      else.
        call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
             exporting
                  src_spoolid              = gt_rq-rqident
                  no_dialog                = ' '
             importing
                  pdf_bytecount            = numbytes
                  pdf_spoolid              = pdfspoolid
                  btc_jobname              = jobname
                  btc_jobcount             = jobcount
             tables
                  pdf                      = pdf
    *************** download PDF file ***********
    v_filename = lv_filename.
    *  call function 'WS_DOWNLOAD'
    *       exporting
    *            bin_filesize            = numbytes
    *            filename                = lv_filename
    *            filetype                = 'BIN'
    *       tables
    *            data_tab                = pdf
    *       exceptions
    *            file_open_error         = 1
    *            file_write_error        = 2
    *            invalid_filesize        = 3
    *            invalid_type            = 4
    *            no_batch                = 5
    *            unknown_error           = 6
    *            invalid_table_width     = 7
    *            gui_refuse_filetransfer = 8
    *            customer_error          = 9
    *            others                  = 10.
    *  if sy-subrc <> 0.
    ** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    **         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *  else.
    *    gv_count = gv_count + 1.
    *  endif.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        BIN_FILESIZE                    = numbytes
        FILENAME                        = v_filename
        FILETYPE                        = 'BIN'
    *   APPEND                          = ' '
    *   WRITE_FIELD_SEPARATOR           = ' '
    *   HEADER                          = '00'
    *   TRUNC_TRAILING_BLANKS           = ' '
    *   WRITE_LF                        = 'X'
    *   COL_SELECT                      = ' '
    *   COL_SELECT_MASK                 = ' '
    *   DAT_MODE                        = ' '
    *   CONFIRM_OVERWRITE               = ' '
    *   NO_AUTH_CHECK                   = ' '
    *   CODEPAGE                        = ' '
    *   IGNORE_CERR                     = ABAP_TRUE
    *   REPLACEMENT                     = '#'
    *   WRITE_BOM                       = ' '
    *   TRUNC_TRAILING_BLANKS_EOL       = 'X'
    *   WK1_N_FORMAT                    = ' '
    *   WK1_N_SIZE                      = ' '
    *   WK1_T_FORMAT                    = ' '
    *   WK1_T_SIZE                      = ' '
    *   WRITE_LF_AFTER_LAST_LINE        = ABAP_TRUE
    *   SHOW_TRANSFER_STATUS            = ABAP_TRUE
    * IMPORTING
    *   FILELENGTH                      =
      TABLES
        DATA_TAB                        = pdf .
    *   FIELDNAMES                      =
    Thanks.

  • I can't Convert midi files into any other format

    A few months ago, I was able to convert midi files into mp3 when one day, I updated iTunes using software update. Ever since the updates I had for my Mac it still hasn't work.
    It has this error that won't allow me to convert. I talked to my friend wrldwzrd89 who is one of my friends and he said that it is because Apple had a piece of data missing allowing midis to be converted to mp3, or any other format.
    Is this true or do you know the solution?

    I can't tell you the exact reason why it doesn't work, but there is an article about this problem and a solution if you have QuickTime Pro:
    iTunes: MIDI files cannot be converted in iTunes 6.0.3 and 6.0.4
    Not the last sentence in the article. That usually means they're working on a fix.
    No guarantee that it will be fixed in the next version however. We'll have to wait and see.
    Hope this helps.
    M
    17' iMac fp 800 MHz 768 MB RAM   Mac OS X (10.4.6)   Several ext. HD (backup and data)

  • Anyone know a tool to convert PLSQL comments into HTML/other formats?

    Hi - does anyone know if there's a tool out there to convert PLSQL comments into HTML or other formats like you can do in Java? Thanks in advance - Jon

    This is only useful if you're using PL/SQL Developer. It has a free plugin called plsqldoc which will generate html pages that are similar to Javadoc pages.
    check here for more information
    http://www.allroundautomations.nl/plsqldevplugins.html
    As an aside , if you haven't already, you may want to devise a way of auto generating your HTML when a change is made or by running a regular batch job. This will ensure that your docs are in sync with the code. Documentation is only valuable if it is kept up to date.
    There is nothing worse than looking at the html docs for a package only to realise the docs are several versions behind the code.

  • How to change in sql_text into normal readable format?

    hi all
    yesterday inour production environment the dev. did wrongly updated one query.
    they want to know who and when did the changes?
    i found some info from dba_audit_object,
    but in that table the column for sql_text is not showing the full query ,it shows the update table_name set column name=new row id where =old row id..
    by using this query i dont know how to trace the sql_query in norma readble format.
    pls help me to sort out this issue..
    Thanks
    M.Murali..

    Hi
    I am little confused with your question...
    >
    they want to know who and when did the changes?
    but in that table the column for sql_text is not showing the full query ,it shows the update table_name set column name=new row id where =old row id..
    by using this query i dont know how to trace the sql_query in norma readble format.
    >
    If you are getting back the update table_name set column name=new row id where =old row id.. statement then you can get back the values you want.so, what does by using this query i dont know how to trace the sql_query in norma readble format mean.The update statement is in readable format only.
    The answer for who and when changed it is
    select USERNAME,to_char(TIMESTAMP,'DD-MON-YY HH24:MI:SS'),USERHOST,TERMINAL,OWNER,OBJ_NAME,ACTION_NAME,SQL_TEXT from DBA_AUDIT_OBJECT;
    The username will be the database username who updated the column.Timestamp will tell you the time when it was done,terminal will give the terminal name of the PC,owner is the object's owner and sql_text is the update command fired by the username on the owner's table.
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    SQL> sho parameter audit
    NAME                                 TYPE        VALUE
    audit_file_dest                      string      C:\ORACLE\PRODUCT\10.2.0\ADMIN
                                                     \MATRIX\ADUMP
    audit_sys_operations                 boolean     FALSE
    audit_trail                          string      DB, EXTENDED
    DB,EXTENDED -- As db, but the SQL_BIND and SQL_TEXT columns are also populated.
    SQL> grant select,insert,update on scott.emp to lap;
    Grant succeeded.
    *FROM THE LAP SESSION DID*
    SQL> update scott.emp set MGR=7777 where MGR=7698;
    5 rows updated.
    SQL> commit;
    Commit complete.
    FROM THE OTHER SYS AS SYSDBA SESSION
    SQL> select count(1) from sys.aud$;
      COUNT(1)
             1
    SQL> select USERNAME,to_char(TIMESTAMP,'DD-MON-YY HH24:MI:SS'),OWNER,OBJ_NAME,ACTION_NAME,SQL_TEXT from DBA_AUDIT_OBJECT;
    USERNAME                       TO_CHAR(TIMESTAMP, OWNER
    OBJ_NAME
    ACTION_NAME
    SQL_TEXT
    LAP                            15-NOV-08 17:31:45 SCOTT
    EMP
    UPDATE
    update scott.emp set MGR=7777 where MGR=7698
    So i am getting the sql_text of the update done by LAP user on the SCOTT's  EMP table.HTH
    Anand

  • Converting Signature data into PKCS#7 format

    Hi All,
    Is there any java api available to convert signature bytes in to PKCS#7 format.
    Here is the scenario.
    downloaded a trail digital id(abc.pfx) file from verisign site.
    then retrieved the private key, certificate and public key information from the pfx file.
    with the help of private key and pdf data, digital signature created.
    Sample code:
    KeyStore keyStore = KeyStore.getInstance("PKCS12");
    // aa.pfx is the Digital ID got from VeriSign
    keyStore.load(new FileInputStream("aa.pfx"), storepswd);
    for(Enumeration e = keyStore.aliases() ; e.hasMoreElements() ;) {
    alias = e.nextElement().toString();
    PrivateKey privKey = (PrivateKey)keyStore.getKey(alias, storepswd);
    java.security.cert.Certificate cert = keyStore.getCertificate(alias);
    PublicKey pubKey = cert.getPublicKey();
    Signature rsa = Signature.getInstance("MD5withRSA");
    rsa.initSign(privKey);
    /* Update and sign the data */
    FileInputStream fis = new FileInputStream("Testing.pdf");
    BufferedInputStream bufin = new BufferedInputStream(fis);
    byte[] buffer = new byte[1024];
    int len;
    while (bufin.available() != 0) {
    len = bufin.read(buffer);
    rsa.update(buffer, 0, len);
    bufin.close();
    /* Returns the signature of all the data updated*/
    byte[] rsaSign = rsa.sign();
    now i want to convert this signature(rsaSign bytes) in to PKCS#7 format and embed in to pdf file. so acrobat reader can verify the signature in pdf file.
    I've found the PdfSignature class in the iText lib. But it is poor.
    so plz let me know if any body know how to convert signature in to PKCS#7 format. any sample code or any URL.
    Thanks in Advance.
    Subhani.

    Use BouncyCastle provider
    http://www.bouncycastle.org/docs/mdocs1.4/index.html
    The package: org.bouncycastle.cms
    Download the package and get the examples in the package org.bouncycastle.cms.test .
    (CMS stands for Cryptographic Message Syntax and is defined in RFC 3369, and is an evolution of PKCS#7 v. 1.5, that is defined in RFC 2315. )

  • Converting a Digital Voice File (DVF) into a readable format.

    Hi there,
    I just bought a Sony digital voice recorder which records files in a format that gets tagged with the extension "DVF" and a Windows machine recognizes as "digital voice file"s. I can't seem to get iTunes to read them. I'm sure it's not a compatible format, but does anyone know of a utility or program or something that will convert DVFs into something a bit more accessible (WAV, MP3, whatever?)
    Many thanks in advance for your help.
    Josh from Dublin

    Best way to find something is google "DVF converter".
    http://ron.ozrock.net/blog/index.php/tech/sony-dvf-files/

  • How to convert .trc into a readable format or txt file

    Hi,
    I tried using tkprof but it output similar to this :
    TKPROF: Release 10.2.0.1.0 - Production on Sun Dec 28 13:42:39 2008
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Trace file: C:\ababil_cjq0_1044568.trc
    Sort options: default
    count = number of times OCI procedure was executed
    cpu = cpu time in seconds executing
    elapsed = elapsed time in seconds executing
    disk = number of physical reads of buffers from disk
    query = number of buffers gotten for consistent read
    current = number of buffers gotten in current mode (usually for update)
    rows = number of rows processed by the fetch or execute call
    Trace file: C:\ababil_cjq0_1044568.trc
    Trace file compatibility: 10.01.00
    Sort options: default
    1 session in tracefile.
    0 user SQL statements in trace file.
    0 internal SQL statements in trace file.
    0 SQL statements in trace file.
    0 unique SQL statements in trace file.
    238 lines in trace file.
    0 elapsed seconds in trace file
    Is this the correct output?
    Cheers,
    Sach

    Output would very based on which file you are trying to convert.
    TKProf can be run from anywhere, even from the client (for administrator type installation AFAIK) of preferably the same Oracle version.
    Best would be to run the same from the database server itself, as there would be no conflicts about versions and interpretation of trace data by the tkprof utility. F.ex. prior to 10g, all timings in trace files were in milliseconds whereas in 10g, it is saved in microseconds.

  • How to convert a string into orcle date format

    i need some information about converting string into date format.i have string like '20-SEP-05' .so we have to convert into date formate like yy-mm-dd' (2005-09-20).how can we do it.

    Here's some code to help. I can't remember what method uses what format though
      public static java.sql.Date sqlDateValueOf( String dateString ) {
        String stringDate = null;
        if ( dateString == null || dateString.length() < 10 ) return null;
        String strDay = "";
        String strMonth = "";
        String strYear = "";
        if ( dateString.substring(4,5).equals( "-" ) ) {
          strDay = dateString.substring(8, 10);
          if ( strDay.length() < 2 ) strDay = "0" + strDay;
          strMonth = dateString.substring(5, 7);
          strMonth = dateString.valueOf(Integer.parseInt(strMonth) - 1);
          if ( strMonth.length() < 2 ) strMonth = "0" + strMonth;
          strYear = dateString.substring(0, 4);
          stringDate = strDay + "-" + strMonth + "-" + strYear;
        else if ( dateString.substring(2,3).equals( "-" ) ) {
          strDay = dateString.substring(0, 2);
          if ( strDay.length() < 2 ) strDay = "0" + strDay;
          strMonth = dateString.substring(3, 5);
          strMonth = String.valueOf(Integer.parseInt(strMonth) - 1);
          if ( strMonth.length() < 2 ) strMonth = "0" + strMonth;
          strYear = dateString.substring(6, 10);
          stringDate = strDay + "-" + strMonth + "-" + strYear;
        Calendar cal = Calendar.getInstance();
        cal.set( Calendar.YEAR, Integer.parseInt( strYear ) );
        cal.set( Calendar.MONTH, Integer.parseInt( strMonth ) );
        cal.set( Calendar.DAY_OF_MONTH, Integer.parseInt( strDay ) );
        java.sql.Date outDate = new java.sql.Date( cal.getTimeInMillis() );
        return outDate;
      public static String toDateString( java.util.Date date) {
        if ( date == null || date.toString().length() < 10 ) return null;
        String outDate = "";
        SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
        outDate = df.format( date );
        return outDate;
      public static String toDateString( java.sql.Date date) {
        if ( date == null || date.toString().length() < 10 ) return null;
        String outDate = "";
        SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
        outDate = df.format( date );
        return outDate;
      public static String toDateString( java.sql.Date date, String format) {
        if ( date == null || date.toString().length() < 10 ) return null;
        String outDate = "";
        SimpleDateFormat df = new SimpleDateFormat( format );
        outDate = df.format( date );
        return outDate;
      public static String toDateString( java.sql.Timestamp date) {
        if ( date == null || date.toString().length() < 10 ) return null;
        String outDate = "";
        SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
        outDate = df.format( date );
        return outDate;
      }

Maybe you are looking for

  • How do you unlock Xcode 5.1 framework files?

    Hi, I'm currently in development of an application using Xcode 5.1 using the Storyboard however, I need to be able to access the code for each window I create in the SB. They are mainly UI files in the frameworks section but it seems like no matter w

  • Can't make an unrated smart playlist in itunes

    i have 1/2 star ratings enabled on my imac. when i make a smart playlist with "ratings is 0" i get a playlist of all 1/2 star rated songs and none rated 0. i have itunes 11. i tried it on my macbook (itunes 10.7) and it works fine. but i don't have 1

  • ListView performance issue

    Hello, I have a list with around 25 items. The appearance of an item is defined in FXML and I use cellFactory of that list to create those items. The item class looks as follows: public class MatchCell extends ListCell<MatchModel> {     @Override    

  • Why no Ipad versions of Skype or Yahoo messenger yet?

    I am really surprised that native iPad versions of skype and yahoo messenger haven't come out yet. I'm beginning to think that it has something to do with ATT? It just doesn't make sense that those companies would not release versions by now. The iPh

  • Want to upgrade osx snow leopard 10.6.3 to 10.6.6

    I want to set up facetime, and I read that I need to have snow leapord 10.6.6 or higher, and I have snow leapord 10.6.3.  Is this correct?  I've been searching as to wear I would upgrade, and cannot locate it.  Call me technically challenged!  :-(  T