Results 1 to 9 of 9
  1. #1
    sandeep43 is offline Member
    Join Date
    May 2011
    Posts
    97
    Rep Power
    0

    Default JFilechooser small doubt, Text in pdf

    Hi Guys,

    For JFileChooser cancel option what code should be plugged into so that only my save JFileChooser window is closed, in my case it is exiting the whole application.

    and also how to make text in pdf bold via java code, i mean any function is available or something else have to be done or what?

    Regards
    Sandeep

  2. #2
    rjagan's Avatar
    rjagan is offline Member
    Join Date
    Feb 2011
    Location
    Puducherry
    Posts
    53
    Rep Power
    0

    Default

    what you are ask? problem in save as pdf format or problem in cancel?
    which code plugged into the cancel?

    Kindly RJ

  3. #3
    sandeep43 is offline Member
    Join Date
    May 2011
    Posts
    97
    Rep Power
    0

    Default

    HI RJ,

    i want for cancel button my save is working absolutely fine and also when i write in my pdf, i wanted my headings in Bold how to make that?

    Regards
    Sandeep

  4. #4
    rjagan's Avatar
    rjagan is offline Member
    Join Date
    Feb 2011
    Location
    Puducherry
    Posts
    53
    Rep Power
    0

    Post

    send the code dude, let me check. with out the code no one can solve the problem

  5. #5
    sandeep43 is offline Member
    Join Date
    May 2011
    Posts
    97
    Rep Power
    0

    Default

    dude i am asking u the code as what should i write i have just written this as below

    Java Code:
    JFileChooser filesaving = new JFileChooser();
    int returnVal= filesaving.showSaveDialog( null);
       switch (returnVal){
           case JFileChooser.APPROVE_OPTION:
               PdfWriter instance = PdfWriter.getInstance(document,new FileOutputStream( filesaving.getSelectedFile()+".pdf"));
               break;
           case JFileChooser.CANCEL_OPTION:
               filesaving.cancelSelection();
               break;
       }
    i want it for cancel dont worry about saving

    Sandeep

  6. #6
    rjagan's Avatar
    rjagan is offline Member
    Join Date
    Feb 2011
    Location
    Puducherry
    Posts
    53
    Rep Power
    0

    Default

    there is no such concept to bold headings in pdfwriter..
    use random access file, create pdf format.. then what ever u need can do...

  7. #7
    rjagan's Avatar
    rjagan is offline Member
    Join Date
    Feb 2011
    Location
    Puducherry
    Posts
    53
    Rep Power
    0

    Default

    <code>
    document.open();
    document.add(new Paragraph("Title"));
    FontFactory.getFont(FontFactory.arial, 18, Font.BOLD, new Color(R, G, B))));

    </code>

    use this code dude.. the problem is solved...

  8. #8
    sandeep43 is offline Member
    Join Date
    May 2011
    Posts
    97
    Rep Power
    0

    Default

    ok fine what about cancel button, when i click it only my FileChooser should close not my application.

    Sandeep

  9. #9
    rjagan's Avatar
    rjagan is offline Member
    Join Date
    Feb 2011
    Location
    Puducherry
    Posts
    53
    Rep Power
    0

    Default

    did you put any code in cancel option like system.exit(0)..
    normally when u click the cancel button in filechooser, it only close the Jfilechooser window only.. not the main frame window..
    check it out clearly.//


    kindly
    rj

Similar Threads

  1. Please help,just a small question
    By JavaDreams in forum New To Java
    Replies: 5
    Last Post: 01-28-2011, 08:15 PM
  2. A small doubt
    By ranganathan in forum New To Java
    Replies: 5
    Last Post: 02-19-2010, 06:18 AM
  3. Replies: 3
    Last Post: 01-29-2010, 05:14 PM
  4. small code, need help
    By p0rnstar in forum New To Java
    Replies: 22
    Last Post: 01-22-2010, 01:57 PM
  5. small doubt
    By ravi kumar in forum Java Software
    Replies: 1
    Last Post: 08-02-2009, 03:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •