Can we print a swing form

hi,
i have a question , i m making a windows based application in swings, can i print that form, reply at the earliest..
thanks in advancee

//or try this program, just execute it.
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.awt.BorderLayout;
import java.awt.print.*;
import java.awt.Dimension;
class printtest extends JFrame implements Printable,ActionListener
Component c;
printtest()
super("just test");
setSize(300,150);
setVisible(true);
JPanel p1=new JPanel(new FlowLayout());
JLabel l1=new JLabel("name");
JTextField t1=new JTextField(10);
JButton b1=new JButton("Print");
b1.addActionListener(this);
t1.setText("hai");
p1.add(l1);
p1.add(t1);
p1.add(b1);
add(p1);
this.c=p1;
public void actionPerformed(ActionEvent e)
try
print();
catch (java.lang.Throwable exc)
System.out.println("Printer
Exception");
public void print() throws java.awt.print.PrinterException {
PrinterJob job = PrinterJob.getPrinterJob();
PageFormat format = job.pageDialog(job.defaultPage());
job.setPrintable(this,format);
if ( job.printDialog())
job.print();
public int print(Graphics graphics, PageFormat pageFormat, int
pageIndex) throws
PrinterException {
if (pageIndex > 0)
return Printable.NO_SUCH_PAGE;
Graphics2D g2 = (Graphics2D) graphics;
g2.translate(pageFormat.getImageableX(),pageFormat.getImageableY());
c.paint(g2);
return Printable.PAGE_EXISTS;
public static void main(String ar[])
printtest t=new printtest();
}

Similar Messages

  • I can't print my PDF form after it is filled out.  Only the form prints not the text that I put in

    I can't print my PDF form after filling it out.  Only the form prints and not the text I put in.

    That's a limitation of Apple's AirPrint framework that Adobe Reader depends on.  We are considering an alternate solution that may resolve this issue though.
    Thanks for your feedback.
    -Gaurav

  • How can I print a completed form, where there are boxes with scrolling capabilities?

    There are text boxes within the form that allow people to input more information in the space provided, so the boxes allow for scrolling.  I am wanting to print a completed form, all of it, but the text boxes only print what is visible. 

    Hello,
    Unfortunately, it is not possible to print the whole form with the complete options. Only selected text can be printed in a form, as printing the document makes it flat. 
    Regards,
    Nakul

  • Can not print a PDF form to PDF

    I have a form set up.  When complete I use the PRINT command to print the form/pdf to a PDF so it becomes uneditable.  I just install Adobe Pro 9.  This worked with Adobe Pro 8.
    Also an odd side note.  I have 2 standard uses using reguler adobe and they can open the PDF containing the form, fill it out and then print to a PDF.
    Anyone know why my 9 Pro will not?

    All Products are up to date with the latest verison to each.
    Here is the flow.
    Created both template in Adobe LiveCycle 8.0.  I have 8.0 pro, others had standard 8.0 or even 7.0 (all with latest patches/updates).
    I then updated to Adobe Pro 9, and others to 9.0 Standard (all with latest patches/updates).
    Since I was update to 9 pro.  I then opened up the forms created in Adobe LiveCycle 8.0 (mentioned above) with Adobe LiveCycle Designer ES 8.2, which came with my 9 Pro.  I made sure that everything was okay, and saved in the new version.  Not sure this even matters, but I did as a procaution.
    Now, my users on 9 Standard can open and fill out form, then print to PDF (to prevent editting to whom it is sent to).
    For me, being on 9 Pro, I can open in Adobe 9.0 Pro, fill it out, but get the error mentioned in my first post above, unable to print......
    What gives?

  • Can I print a PDF form that has fields that have been overfilled?

    The form is set up as an evaluation and the field has been filled out past the viewable area so it turns into a scrollable field. I'd like to print so all of the text prints from each form field.

    Not directly.
    You could use the "Compile returned forms"  to put the form data into Excel.
    Or you could export the form to an FDF and them make a version of your form with larger field sizes and import the FDF.

  • Can I print my submitted forms in bulk?

    1st of all I'm totally confused as to why I have both Adobe Acrobat Pro and Forms Central, but no worries there I suppose.  I created my new form in Forms Central and was able to "publish" or share the form on my website via Forms Central.  The user then completes the form and submits it to me.  What I do not know how to do is to print all of the submitted forms in "bulk".  It appears to me, thus far, that I have to click on each form and save it to my computer and then print it!  I am expecting 100's of these forms to come in and was hoping that I could just print ALL the forms at once without saving each individual form to my Macbook.  Please advise!

    Select your slides, go to File>Page Setup and change to portrait.

  • How can I print out a form as it looks after it is filled out???

    I would like to have people fill out a form then when they
    submit it or print it the page will print as it looks on the site
    or email the completed form as it appears on the site. I have seen
    things like this before but I am not sure how it is accomplished.
    Anyone got some input for me?
    Thanks
    Jamie

    what server side language are you using?
    You can capture any form data in the page you send the form
    to. That page
    can display the data, confirm it, or do something else with
    it (enter into
    db, email, whatever).
    For example,
    Username: <?php echo $_POST['username'] ?>
    Password: <?php echo $_POST['password'] ?>
    Would give you the username and password of somebody that
    just logged in.
    You language specifics will change.
    "Jamie05" <[email protected]> wrote in
    message
    news:e7u3b9$7vp$[email protected]..
    >I would like to have people fill out a form then when
    they submit it or
    >print
    > it the page will print as it looks on the site or email
    the completed form
    > as
    > it appears on the site. I have seen things like this
    before but I am not
    > sure
    > how it is accomplished. Anyone got some input for me?
    > Thanks
    > Jamie
    >
    >

  • How can I print a PO form back to back

    Hi
    I am having one PO form.Totally I am having 15 items in this.These details I need to print back to back on single paper.The first page consists.company logo,vendor and delivery address details only.After that The page printing 5 records and it will go to another paper for printing.But my client needs back to back printing.How can I do this thing.Please help me to solve this problem.

    Hi Aruna ,
    You want to print both side of the paper or only back side of the paper?, if u want to print both side of
    the paper then you can select only 'DUPLEX' in the printing options.
    Best Regards,
    Narasimha Rao.

  • Forms Central: Can I print a completed form?

    I made a form in Acrobat XI and uploaded it to Forms Central. I filled it out myself as a test and I can't seem to print the response with completed fields - as it appeared just before I hit the "submit" button. I NEED to be able to do that with this particular form. I can't use the "row details" and print that because I need to be able to print individual responses EXACTLY as I set up the form. Am I just missing the way to do this, or is it not an option? If it's not an option, I'm afraid I'm stuck as to how to distribute it.

    after clicking save as pdf, do i have option to omit fields that the user didn't input data into?
    for example, i have 100 fields for user input on an order form.
    user inputs 30 out of 100 (because they aren't buying every item).
    i want to print out an order form from their submission, but i want to see only the 30/100, and not all these blank fields occupying paper space.
    does formscentral have this option- to print only user data (and associated description/text)?

  • I can't close my swing form ...

    I have a JFrame swing GUI - how do I exit the app ?
    How do I display a popup box with a message ? or question ?
    thanks !
    Craig

    To close the frame, in the constructor, add:
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent evt) {
    System.exit(0);
    To pop up a prompt, add this when you click, say, "Exit" from a menu or button:
    int ans = JOptionPane.showConfirmDialog(this,"Do you want to exit the application?", "ExitDialog", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
    if (ans == JOptionPane.YES_OPTION)     {
    System.exit(0);
    }

  • How can i print a form?

    how can i print a survey form?

    Sorry it is not possible to print all pages of a HTML form. People would have to print each pages individually as they are filling the form.
    You might concider distributing the PDF form instead of the HMTL form
    Click on the "Distribute Tab - > Save Submission-enabled PDF" button
    The filler could then use the free Acrobat Reader to fill-out the form, submit the data back to you and print it.
    Gen

  • Problem in printing a java swing form

    Hi,
    Could anyone help me on how to set the page margings while I print a java swing form since it is taking a lot of space as margins in the top right top and bottom how do i do that. or is it that java can only print in the printable area or is there any way i can increase the scope of the printable area

    I used PrintRequestAttributeSet and set the margins to 0.5 on all four sides by creating an instance of MediaPrintableArea. By default, the margins on all sides comes up as 1.0 inch. Default paper size is LETTER (8.5 x 11).
    PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
    aset.add(new MediaPrintableArea(0.5f,0.5f,7.5f,10.0f,MediaPrintableArea.INCH);
    PrinterJob printJob = PrinterJob.getPrinterJob();
    printJob.setPrintable(component);
    if(printJob.printDialog(aset))
    printJob.print(aset);
    hope it helps.

  • No printing :I can't print anymore, printing the same file with another programs is ok, printing form LR: Preparing  and Printing indicatorbar in the left hand upper corner are running, but no output at all rom my printer. I have been printing before. I u

    No printing :I can't print anymore, printing the same file with another program is ok, printing form LR (in the same system and printer of course :-) ): Preparing  and Printing indicatorbar in the left hand upper corner are running and completing, but no output at all to my printer. I have been printing before. Next I upgraded to LR5.7.1 but the problem stays. Perhaps some adjustment is changed by me unintentionally, but I have no idea. Does anybody know what to check? Printing to file is also strange,the canvas only seems to accept A4, and crops any image relative to that size, so a 10x15 cm print on 10 x 15 cm paper is cropped to 10x15/2. Anybody any idea? (system win 8.1 64, printer HP B8550)

    I accidentally solved my mystery.  For some reason it was set to "print to file".  I changed it to "printer" and now I am able to print.

  • I can't print the form correctly in Russian

    Hello I have paid account for FormsCentral. Some of my forms are in Russian. I can create forms, my clients can fill in the forms and I can view the responses on the screen without any problem. But when I try print response or transform in in pdf I get page without Russian letters (only ??????? symbols). Can I solve this problem?

    I can print Russian text without any problem from other apps on my computer (Word, Exel etc). Ok. I'll try from other computer once again, if you think that problem can be in my computer
    Best regards,
    RusComRus Team
    13.03.2013, в 13:03, Wenlan_Du <[email protected]> написал(а):
    Re: I can't print the form correctly in Russian
    created by Wenlan_Du in FormsCentral - View the full discussion
    It still prints well for me from Chrome on Win XP. Are you able to print out Russian text from apps other than FormsCentral, such as MS Word, other web sites in Chrome or other browsers?
    Thanks,
    Wenlan
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5144021#5144021
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5144021#5144021
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5144021#5144021. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in FormsCentral by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • How  can i print currency symbol in smart form?

    how  can i print currency symbol in smart form?
    i want to print the currency symbol with grant total based on the vendor currency.
    pls hepl............

    Hi,
    think You can't print the symbols for currency like $ and Pound etc
    see this doc if needed
    A variable in SAPscript is called a symbol. There are the following types.
    • System symbol (e.g. the number of the current page)
    • Standard symbol (usable in any document)
    • Program symbol (value from the print program)
    • Text symbol (“local variable”)
    The value of a symbol is text for using within SAPscript code and is represented by the symbol-name enclosed by ampersands. On seeing the tell-tale ampersands in SAPscript code, you sometimes need to figure out the symbol type.
    goto any PAGEWINDOW's Text elements in Script (SE71)
    from the Menu-> INSERT-> Symbols
    you find all symbols here
    System symbols
    System symbols in a SAPscript form are comparable to system fields like SY-UZEIT in an ABAP program, and include these. The graphical editor offers three types of system symbol.
    1. General system symbols
    See the table TTSXY. PAGE is the most widely used. The list given in our BC460 training manuals is out of date.
    2. SAPscript system symbols
    See the dictionary structure SAPSCRIPT. SAPSCRIPT-FORMPAGES is the most widely used.
    3. ABAP system symbols
    For the ABAP system field SY-UNAME, say, the symbol is SYST-UNAME. http://SYST is the dictionary structure for ABAP system fields.
    Sample code:
    User: &SYST-UNAME&
    Page &PAGE& of &SAPSCRIPT-FORMPAGES(C3)&
    Standard symbols
    Standard symbols are maintained centrally (in the table TTDTG via transaction SE75) for use in any document. Menu path:
    Tools
    Form Printout
    Administration
    Settings
    Some standard symbols are SAP-standard and others are custom. Curiously, table TTDTG is cross-client although SAPscript forms are not.
    The value of a standard symbol has to be defined for each language used. This gives a way to make a single SAPscript form multi-lingual.
    We can take advantage to an extent of the central maintenance, though there is no guarantee that the available standard symbols will used in every appropriate context.
    Standard symbols complicate searching a SAPscript form, since text like ‘Charity registration 211581’ may be hiding in a standard symbol.
    Text symbols
    A text symbol is declared and assigned to within the SAPscript code, and so obviously applies only to the current document. The command DEFINE is used, requiring /: in the tag column, as in the following examples.
    /: DEFINE &COMP_NAME& = ‘University of Warwick’
    /: DEFINE &WS_RATE& = &TAX_SUMM_C&
    Reward points for useful Answers
    Regards
    Shiva Kumar

Maybe you are looking for

  • Need a good backorder report

    need a report showing items on backorder on open sales orders. v.15 and co06 are of no value to us does anyone have suggestions?

  • How do i create a directory in powershell

    How do i create a directory in power shell

  • Error 1336 when I install or uninstall NI Labview related files.

    The error message is: "Installer Error There was an error creating a temporary file that is needed to complete the installation" My IT guys found that the installer is trying to create a temporary file for a Mozilla plug-in. WHY IS IS IT NECECCASY TO

  • Not able to see portal language in Personalize option

    Hi All, I login as an administrator, click Personalize option in the masthead ivew, I m unable to see the Portal Language option. Other options such as workprotect mode and user mapping(remote iviews) are also not shown. I m using EP6 SP13. Is it bec

  • Callto: action

    OK I give up; spent an hour or more trying to get a "button" or link on a phone number on an iPhone app to auto dial the displayed number. I found on the web that I could use callto: as in mailto: and use that in the url field of a button, but that f