Not Printing the Content of Object:SOme Garbage Value on Screen

i have made one program of Vehicle class which adds and prints the Details of Vehicles in the ArrayList but it always showa the Garbage Value in return.
import java.util.*;
import java.awt.*;
import java.lang.*;
import java.io.*;
public class Vehicle
     private int reg_no;
     private String model_name;
     private int model_no;
     private int yr_manufacture;
     private String veh_type;
     private int price;
     private int weight;
     private String veh_status;
     public ArrayList vehicles;
     static BufferedReader keyboard = new BufferedReader (new InputStreamReader (System.in));
     public Vehicle()
          //super();          
          vehicles=new ArrayList(10);
     public Vehicle(int regno,String mo_name,int mo_no,int year_manu,String type_veh,int cost,int weight,String status)
     this.reg_no=regno;
     this.model_name=mo_name;
     this.model_no=mo_no;
     this.yr_manufacture=year_manu;      
     this.veh_type=type_veh;
     this.price=cost;
     this.weight=weight;
     this.veh_status=status;
     public void addVehicle() throws IOException
          int regno;
          String mo_name;
          int mo_no;
          int year_manu;
          String type_veh;
          int weight=0;
          int no_person;
          int cargo;
          int cost;
          String status;
          String confirm;
          int countvehicle=0;
          //start of do-while loop
          do {
               System.out.print("Input the Vehicle Registration Number(Integer):");
               regno=Integer.parseInt(keyboard.readLine().trim());
               System.out.print("Input the Vehicle Make(String)eg. Mercedes,Ferrari,BMW etc: ");
               mo_name=keyboard.readLine();
               System.out.print("Input the Vehicle Model(Integer): ");
               mo_no=Integer.parseInt(keyboard.readLine().trim());
               System.out.print("Input the Vehicle Manufactured Year(Integer): ");
               year_manu=Integer.parseInt(keyboard.readLine().trim());
               System.out.print("Input the Vehicle Type:(CAR/BUS/TRUCK)");
               type_veh=keyboard.readLine();
               System.out.print("Where do u want this Vehicle to be Loaded:(Type F or I)?");
               status =keyboard.readLine();
                    if(countvehicle>6 && status.equals("I"))
                    System.out.println("Sorry.........Ferry is Overloaded your Vehicle will be Loacally on the Island");
                    status="Island";
                    System.out.println("Vehicle in Island");
                    else
                         System.out.println("Vehicle loaded on to Ferry");
                         status="Ferry";
               //decide the weight Factor for the Vehicle
               if(type_veh.equals("CAR"))
                    weight=1500;                
               else if(type_veh.equals("BUS"))      
                    System.out.print("Input the boarding No of Person in Bus: ");
                    no_person=Integer.parseInt(keyboard.readLine().trim());
                    weight=(10000+(no_person*75));// Assuming the weight of one Person is 75kg.
               else if(type_veh.equals("TRUCK"))
                    System.out.print("Input the Truck Cargo Load: ");
                    cargo=Integer.parseInt(keyboard.readLine().trim());
                    weight=(4500+cargo);                
               System.out.print("Input the Vehicle Price: ");
               cost=Integer.parseInt(keyboard.readLine().trim());
               Vehicle regVehicle= new Vehicle (regno,mo_name,mo_no,year_manu,type_veh,cost,weight,status);
               vehicles.add(regVehicle);//Add to the Vector
               regVehicle.printall();
               //Saving the Added Object in File
               /*try
                         FileOutputStream f_out = new FileOutputStream("Added.txt");                    
                         ObjectOutputStream obj_out = new ObjectOutputStream(f_out);
                         obj_out.writeObject(vehicles.add(regVehicle));
                    catch (FileNotFoundException e)
                         System.err.println("Error:"+ e.getMessage());
                    catch (IOException e)
                         System.err.println("Error:"+ e.getMessage());
               countvehicle++;
               System.out.print ("Add a new vehicle (y or n)? ");
               System.out.flush();      
     confirm= keyboard.readLine();
               } while (confirm.equals("y")); //end of do while loop
     public Vehicle getVehicle(int index) throws IOException
          return (Vehicle)vehicles.get(index);
     public int getRegNo() throws IOException
          return reg_no;               
     public Vehicle lookUpVehicle (int accnos)throws IOException
//start of for loop
          for(int i=0;i<vehicles.size();i++)
          //checks if the information entered are correct using an if statement
          if((((Vehicle)vehicles.get(i)).getRegNo()) == accnos)
               return ((Vehicle)vehicles.get(i));
return null;
     public void printDetails()throws IOException
          System.out.println("--------Vehicle Details------------ ");
     for(int i=0;i<vehicles.size();i++)
          System.out.println(" " + getVehicle(i));           
     //System.out.println("\n\n");
     //return ((Vehicle)elements());*/
     /*Iterator it = vehicles.iterator();
          while (it.hasNext())
               System.out.println(it.next());
     public void printall()
          System.out.println(reg_no);
          System.out.println(model_name);
          System.out.println(model_no);
          System.out.println(weight);
}

sohamdave wrote:
what toString will contain in them.i didn't get you there.it is the whole data type-casted to String or only object type-casted to StringSimply return a String representation of the Vehicle object; frequently the String contains the member variable values, e.g.
public String toString() {
   return model_name+" "+veh_type;
}The List toString() method itself invokes your method when the List itself needs to be printed.
kind regards,
Jos

Similar Messages

  • I have a MG6320 Printer. It will not print the contents of an email, only the outline

    I have a Canon MG 6320 printer. When I call up an email in GMail, it will not print the contents of the email, only the words and figures displaye don rails down the side and at the top. Can anyone tell me what I can do to change this?
    James O'Shea

    Hi JOShea432,
    In order to assist with this issue we will need more information.  Is the problem only occuring in Gmail?  If so, are you using the print button from within Gmail or are you using the print option under the File menu in your web browser?
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • I have a PDF that it was send to me and I can not print the content

    I have a PDF file send to me to fill the blank , now that I did finish on my print it does not show the content I did typed?

    Is this a form? If so, are you filling it out using Mac Preview? If so, fill out the form using Adobe Reader instead.

  • Can not print the contents of an E-Mail message

    I'm running both Firefox and Nightly and it happens with both but not with IE. My E-Mail is SMTE. If I go to print or print preview of my E-Mail message, there is nothing there but I can cut and paste the text out of the message into Word and then I can print it. I suspect. Double checking, I can not print anything from the browser

    To print part of the list (assuming they are in the
    first slots, and all nulls are at the end):
    System.out.println(Arrays.asList(arrayOfStrings)
    .subList(0, numberOfNames));
    many thanks, this has helped alot!
    the only problem i am now facing is that i have done it via RMI and every time i send a message the person who sends the message becomes added to the list again, for example i end up with a long list like:
    online = sun, sun, sun, sun, sun
    when there is only one sun! this list increases every time a message is sent!
    i only want the name there once!
    and also on the first sending there is no value in the array, starts off [ ] when sun is online.
    thanks

  • SSRS 2008 R2 report does not print the page header for a html content displaying on multiple pages

    Hi
    I need to display the html content from the database. The html content are quite long and can have content of 3-5 pages. Issue I  am facing is f the record has html content of 3-5 pages, then it does not print the page header (which is a separate tablix) on
    second page onwards.
    Nikesh Shah
    Nikesh Shah

    Hi Nikesh,
    According to your description, I’m not sure the meaning of Page header in your scenario. In Reporting Services, a page header that run along the top of each page, respectively. Headers can contain static text, images, lines, rectangles, borders, background
    color, background images, and expressions. But we couldn’t add tablix in the page header.
    If you are saying report header, a report header consists of the report items that are placed at the top of the report body on the report design surface. They appear only once as the first content in the report. So it cannot repeat in other pages.
    If you are saying tablix header, freezing column headers are different in table and matrix. For more details, please refer to the following thread:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/c8ddc1af-1bdf-4e72-8aab-0353c7cc848a/ssrs-report-freezing-row-and-column-while-scrolling-issue?forum=sqlreportingservices
    If there are any misunderstanding, please elaborate the issue for further investigation.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • I wonder about the colors in the program. When i work and later gonna print the text i have some problem. The color is not the same when im print it. One color on the screen and another when i print it why?

    I wonder about the colors in the program. When i work and later gonna print the text i have some problem. The color is not the same when im print it. One color on the screen and another when i print it why?

    I wonder about the colors in the program. When i work and later gonna print the text i have some problem. The color is not the same when im print it. One color on the screen and another when i print it why?

  • ITS 6.1 :  Printing the contents in a  container in webgui

    Hai All,
    I have a  module pool program which displays, employees details with there photo in a container. I used method  "CALL METHOD html_control->execwb." to print the content within the container. The program works fine when i run the program in SAP gui. I have created the transaction code as "SAP GUI for HTML"
    The problem is we are using ITS server 6.1, when i run the same program in webgui, the print functionality is not working. The reason being the above method is related to OLE, which will not work in "SAP GUI FOR HTML".
    We can print the content of the container by right clicking whithin the container and selecting print. Is it possible to have that functionality by clicking a button in the screen. That is when the user clicks a button in the screen the content of the container should be printed.
    Please let me know, is there any solution for this.
    Thanks & Regards,
    H.K.Hayath Basha.

    Hi Hayath,
    this method is Windows only. Neither webgui nor java gui support the method because it based on OLE.
    But you can insert a link in the HTML and execute the print method of the window object when clicking on the link.
    Example:
    <html><head><title>Test</title>
    </head><body>
    <a href="javascript:window.print()">Print this page</a>
    </body></html>
    Regards,
    Klaus
    P.S.: I would recommend to upgrade to ITS 6.20. ITS 6.10 is no longer supported by SAP and SAP will refuse any OSS message regarding ITS 6.10.

  • How to print the content of LinkedList int[] and LinkedList LinkedList ?

    Hi guys, its been a long time since i posted here, and now im coming back to programming using java. My problem is, how can i print the content of the list?
    Example:
    LinkedList<int[]> list = new LinkedList<int[]>;
    int[] input = {1,2,3,4,5};
    int[] input2 = {2,32,43,54,65};
    list.add(input);
    list.add(input2);
    how can i print all the content of the linkedlist?
    Please help me..I know its a dumb question but i really dunno how.
    here is the code:
    import java.util.LinkedList;
    import java.util.Scanner;
    import java.util.Arrays;
    public class Test{
         static void printThis(String[] in){
              System.out.print("Value: ");
              for(int i = 0;i<in.length;i++){
                   System.out.print(in[i] + " ");
              System.out.println();
         static void reset(String[] val){
              for(int i = 0;i<val.length;i++){
                   val[i] = "";
         public static void main(String[] args){
              LinkedList<String[]> list = new LinkedList<String[]>();
              LinkedList<String> listTrans = new LinkedList<String>();
              System.out.print("Enter the number of records: ");
              Scanner s = new Scanner(System.in);
              int numOfRecords = s.nextInt();
              System.out.print("Enter the number of records per run: ");
              s = new Scanner(System.in);
              System.out.println();
              int numOfRecordsInMemory = s.nextInt();
              String[] getData = new String[numOfRecords];
              String[] transferData = new String[numOfRecordsInMemory];
              int numOfRuns = 0;
              int counter = 0;
              for(int i = 0;i<numOfRecords;i++){
                   counter++;
                   System.out.print("Enter value number " + counter + ": ");
                   Scanner scan = new Scanner(System.in);
                   getData[i] = scan.next();
                   listTrans.add(getData);
              if(getData.length%numOfRecordsInMemory == 0){
                   numOfRuns = getData.length/numOfRecordsInMemory;
              }else if(getData.length%numOfRecordsInMemory != 0){
                   numOfRuns =(int)(getData.length/numOfRecordsInMemory)+ 1;
              System.out.println();
              System.out.println("Number of Runs: " + numOfRuns);
         int pass = 0;
         System.out.println("Size of the main list: " + listTrans.size());
         while(listTrans.size() != 0){
              if(listTrans.size() >= numOfRecordsInMemory){
                   for(int i = 0;i<numOfRecordsInMemory;i++){
                        transferData[i] = listTrans.remove();
                   System.out.println("Size of the list: " + listTrans.size());
                   printThis(transferData);
                   System.out.println();
                   Arrays.sort(transferData);
                   list.add(transferData);
                   reset(transferData);
              }else if(listTrans.size() < numOfRecordsInMemory){
                   pass = listTrans.size();
                   for(int k = 0;k<pass;k++){
                        transferData[k] = listTrans.remove();
                   System.out.println("Size of the list: " + listTrans.size());
                   printThis(transferData);
                   System.out.println();
                   Arrays.sort(transferData);
                   list.add(transferData);
                   reset(transferData);
    //This is the part that is confusing me.
    //im trying to print it but its not working.
              System.out.println("Size of the next list: " + list.size());
    //          for(int i = 0;i<list.size();i++){
    //                    System.out.println();
    //               for(int j = 0;j<list.get(i)[j].length();j++){                    
    //                    System.out.print(list.get(i)[j] + " ");

    Here's the funnest, mabye clearest way you could do it: Use 2 Mappers
    package tjacobs.util;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    import tjacobs.Arrays;
    public class Mapper <T>{
         public static interface MappedFunc<T> {
              void map(T value);
         public Mapper(T[] vals, MappedFunc<T> function) {
              this (new Arrays.ArrayIterator<T>(vals), function);
         public Mapper(Iterator<T> iterator, MappedFunc<T> function) {
              while (iterator.hasNext()) {
                   function.map(iterator.next());
         public static void main(String[] args) {
              String[] s = new String[] {"a","b", "c", "abc", "ab"};
              MappedFunc<String> func = new MappedFunc<String>() {
                   public void map(String s) {
                        if (s.toLowerCase().startsWith("a")) {
                             System.out.println(s);
              Mapper m = new Mapper(s, func);
    }

  • Can you print the contents of a blob in Bi Publisher

    For example, Bi Publisher generate a pdf file in apex that will print the contents of a blob.
    Let's say you have a record with test.xls in a blob, can I take the test.xls out of the record and have bi publisher print it.
    Thanks,
    Doug

    BI Publisher can add some blobs to a report, such as a .jpg / .gif / .png, but excel just doesn't make sense, nor do I think it would work.
    Tyler Muth
    http://tylermuth.wordpress.com
    "Applied Oracle Security: Developing Secure Database and Middleware Environments": http://sn.im/aos.book

  • Error consuming Web service - content type text/xml;charset=utf-8 of the response message does not match the content type of the binding

    Hi all,
    We are trying to interact with Documentum server through DFS exposed WCF which communicates through port 9443 and we are provided with documentum issued Public Key certificates. We have successfully imported the certificates in client machine and configured
    the bindings as below in our .Net web application config file.
    <system.serviceModel>
    <bindings>
    <wsHttpBinding>       
    <binding
    name="ObjectServicePortBinding1">
    <security
    mode="Transport">
    <transport
    clientCredentialType="None"
    proxyCredentialType="None"
    realm=""
    />
    <message
    clientCredentialType="Certificate"
    algorithmSuite="Default"
    />
    </security>
    </binding>
    <binding
    name="QueryServicePortBinding">
    <security
    mode="Transport">
    <transport
    clientCredentialType="None"
    proxyCredentialType="None"
    realm=""
    />
    <message
    clientCredentialType="Certificate"
    algorithmSuite="Default"
    />
    </security>
    </binding>
    </wsHttpBinding>
    </bindings>
    Also, we set the message encoding as MTOM and the wcf client object initialization code snippet is as below,
    ObjectServicePortClient
    serviceClient = new
    ObjectServicePortClient(new
    WSHttpBinding("ObjectServicePortBinding1"),
    new
    EndpointAddress(UriUtil.ObjectServiceUri));
    if (serviceClient.Endpoint.Binding
    is
    WSHttpBinding)
       WSHttpBinding
    wsBinding = serviceClient.Endpoint.Binding as
    WSHttpBinding;
    wsBinding.MessageEncoding =
    "MTOM".Equals(transferMode) ?
    WSMessageEncoding.Mtom :
    WSMessageEncoding.Text;
    serviceClient.Endpoint.Behaviors.Add(new
    ServiceContextBehavior(Config.RepositoryName,
    Config.DocumentumUserName,
    Config.DocumentumPassword));
    When we execute the above code, we are getting error message as below,
    Exception: The content type text/xml;charset=utf-8 of the response message does not match the content type of the binding (multipart/related; type="application/xop+xml"). If using a custom encoder, be sure that the IsContentTypeSupported
    method is implemented properly. The first 407 bytes of the response were: '<?xml version="1.0" ?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope"><faultcode>S:VersionMismatch</faultcode><faultstring>Couldn't
    create SOAP message. Expecting Envelope in namespace http://schemas.xmlsoap.org/soap/envelope/, but got http://www.w3.org/2003/05/soap-envelope </faultstring></S:Fault></S:Body></S:Envelope>'
    Then, we changed the bindings as below
    <system.serviceModel>
    <bindings>
    <wsHttpBinding>       
    <binding
    name="ObjectServicePortBinding1">
    <security
    mode="Transport">
    <transport
    clientCredentialType="Certificate"
    proxyCredentialType="None"
    realm=""
    />
    <message
    clientCredentialType="Certificate"
    algorithmSuite="Default"
    />
    </security>
    </binding>
    <binding
    name="QueryServicePortBinding">
    <security
    mode="Transport">
    <transport
    clientCredentialType="
    Certificate"
    proxyCredentialType="None"
    realm=""
    />
    <message
    clientCredentialType="Certificate"
    algorithmSuite="Default"
    />
    </security>
    </binding>
    </wsHttpBinding>
    </bindings>
    We are getting another error message,
    Exception: The client certificate is not provided. Specify a client certificate in ClientCredentials.
    Any pointers on resolving this issue would be highly helpful.
    Thanks

    Hi Dhanasegaran,
      As per your case, the corresponding details which may guide you to resolve this issue:
    1. First of all, you can try to call the wcf service directly from the browser & check where it will point out the correct location.
    2. In config file ,Set IncludeExceptionDetailInFaults to true to enable exception information to flow to clients for debugging purposes .
    Set this to true only during development to troubleshoot a service like below :
    <serviceBehaviors>
      <behavior name="metadataAndDebugEnabled">
        <serviceDebug
          includeExceptionDetailInFaults="true"   
    />
        <serviceMetadata
          httpGetEnabled="true"
          httpGetUrl=""   
    />
      </behavior>
    </serviceBehaviors>
    3. I suggest you to change that <security mode ="TransportWithMessageCredential"> instead of <security mode ="Transport">
     for more information, refer the following link :
    https://msdn.microsoft.com/en-us/library/aa354508(v=vs.110).aspx

  • Database schema SCM does not contain the associated database objects

    I am getting the following error when i am trying to migrate the form to apex using application migration.
    "*Database schema SCM does not contain the associated database objects for the project, aafs.*
    *Ensure the database schema associated with the project contains the database objects associated with the uploaded Forms Module .XML file(s).* ".
    Actully i am having one schema which i named as SCM, and i have defined one table TT.
    I created one form test.fmb in which i used TT table.its compiled successfully.
    Then i generated the xml file using frmf2xml from fmb file. After that, I created the project in appication migration wizard in SCM schema.
    Project creattion is working fine.but when i m trying to create application,it is showing me above error.
    can any one help in solving this problem.

    Hi Hilary,
    Thanks for your response/feedback.
    1. The schema associated with the project does not contain the necessary objects Can you please verify that the schema associated with your Forms conversion project does in fact contain the objects associated with the uploaded files. Could you also verify that the object names referenced in the error message do not exist within the schema associated with your workspace. Ensure that the schema associated with the project contains the necessary database objects before proceeding to the generation phase of the conversion process.
    Ans:
    Yes it does contain the objects (See results from SQL query Commands below):
    SELECT MWRA_CONTRACT_NO, OLD_CONTRACT_NO FROM PROJECTS@CONTRACT_LX19.MWRA.NET
    ORDER BY MWRA_CONTRACT_NO
    000000569 551TA
    000000570 553TA
    000000575 560TA
    000000576 561TA
    000107888 502TA
    000108498 500TA
    000108502 503TA
    2. The block being converted contains buttons, which may have been incorrectly identified as database columns, and included in the original or enhanced query associated with your block This is a known issue ,bug 9827853, and a fix will be available in our upcoming 4.0.1 patch release. Some possible solutions to this issue are:
    -> delete the buttons before generating the XML
    -> delete the button tags from the XML
    -> add "DatabaseItem=No" for the button in the XML file before importing it in Apex.The button is excluded when creating the Application.
    Ans
    yes it does contain push buttons to transfer to another forms and these are defined as Non data base items. Parial XML code provided below:
    - <Item Name="REPORTS" FontSize="900" DirtyInfo="true" Height="188" XPosition="4409" FontName="Fixedsys" ForegroundColor="black" DatabaseItem="false" Width="948" CompressionQuality="None" YPosition="3709" FontSpacing="Normal" Label="REPORTS" BackColor="canvas" FillPattern="transparent" ShowHorizontalScrollbar="false" FontWeight="Medium" ShowVerticalScrollbar="false" FontStyle="Plain" ItemType="Push Button">
    <Trigger Name="WHEN-BUTTON-PRESSED" TriggerText="GO_BLOCK('REPORT_1');" />
    </Item>
    - <Item Name="TRACKHDR" FontSize="900" DirtyInfo="true" Height="188" XPosition="3409" FontName="Fixedsys" ForegroundColor="black" DatabaseItem="false" Width="948" CompressionQuality="None" YPosition="3709" FontSpacing="Normal" Label="TRACK" BackColor="canvas" FillPattern="transparent" ShowHorizontalScrollbar="false" FontWeight="Medium" ShowVerticalScrollbar="false" FontStyle="Plain" ItemType="Push Button">
    <Trigger Name="WHEN-BUTTON-PRESSED" TriggerText="GO_BLOCK('TRACKHDRS');" />
    </Item>
    - <Item Name="SUBAWRD" FontSize="900" DirtyInfo="true" Height="188" XPosition="2429" FontName="Fixedsys" ForegroundColor="black" DatabaseItem="false" Width="948" CompressionQuality="None" YPosition="3719" FontSpacing="Normal" Label="SUBAWARDS" BackColor="canvas" FillPattern="transparent" ShowHorizontalScrollbar="false" FontWeight="Medium" ShowVerticalScrollbar="false" FontStyle="Plain" ItemType="Push Button">
    3. If you are still experiencing issues, then please create a testcase on apex.oracle.com and update this thread with the workspace details so I can take a look.
    Test case details are given below. It was created per ORACLE for open Service Request Number 3-1938902931 on ORACLE Metalink.
    Workspace: contract4
    username: [email protected] (my email)
    Password: contract4
    Comments:
    For my migration/testing purpose a dabatase link and synonyms have been setup by our ORACLE DBA. Could this be causing this problem?
    Do we know when the fix 4.0.1 patch release will be available?
    Thanks for your help.
    Indra

  • Urgent: how to print the contents displayed in JTextPane

    hi all,
    i've a problem printing the contents typed in styled format in JTextPane, when i print the contents nothing is printed. can anyone tell how can i print the contents typed in styled format or so. the code for implementing the print is given below.
    class ContentsArea extends JTextPane implements Pritable {
       public int print(Graphics g, PageFormat pf, int pi) throws PrinterException {
          if (pi >= 1) {
             return Printable.NO_SUCH_PAGE;
          Graphics2D g2d = (Graphics2D) g;
          g2d.translate(pf.getImageableX(), pf.getImageableY());
          g2d.translate(pf.getImageableWidth() / 2,
                          pf.getImageableHeight() / 2);
          Dimension d = getSize();
          double scale = Math.min(pf.getImageableWidth() / d.width,
                                    pf.getImageableHeight() / d.height);
          if (scale < 1.0) {
              g2d.scale(scale, scale);
          g2d.translate(-d.width / 2.0, -d.height / 2.0);
          return Printable.PAGE_EXISTS;
    }i'd be grateful to all ppl who helps me.
    Afroze.

    What's the exact problem? The printer printing a blank sheet or the printer not doing anything at all? First make sure in the main program you've got something along the lines of...
    import java.awt.print.*;
    PrinterJob printerJob = PrinterJob.getPrinterJob();
    PageFormat pageFormat = printerJob.defaultPage();
    if(!printerJob.printDialog()) return; //not essential but lets the user tweak printer setup
    pageFormat = printerJob.pageDialog(pageFormat); //ditto
    printerJob.setPrintable(this, pageFormat);
    print(...);
    The above code should go in an ActionListener, triggered when the user hits a print button or menuitem. I'm guessing you already have something similar set up.
    Then your print(...) method should be similar to
    public int print(Graphics g, PageFormat pageFormat, int pageIndex)
         if(pageIndex>0) return NO_SUCH_PAGE;
         Graphics2D gg = (Graphics2D)g;
         gg.draw(whatever's going to be printed);
         return PAGE_EXISTS;
    Which it is, although yours has clever scaling stuff built in ) The only thing you're not doing is rendering the actual content.
    So if you want the contents of the textpane, it'd make sense to use something like g.drawString(myTextPane.getContents()); in the print method. Note it's g and not g2d, since Graphics2D has more complicated text handling routines.
    I'm no expert tho )

  • What is the best way  to print the contents within a scrolling textbox in a fillable form?

    I have created a form using Acrobat 9 Pro which contains several text boxes that allow for unlimited text.  When printing out completed forms,  any text that requires scrolling will not print.  Is there any way to be able to print the contents of all text boxes regardless of length of content?

    Yes, when you set the font size to Auto, the font size shrinks to include all the entered text in the visible area. Otherwise the hidden the text is not displayed and you see observe a "+" sign. You might also want to consider the option to make your form flowable using Adobe LiveCycle Designer.
    ~Deepak

  • TS1363 itunes can not read the contents of the iphones "iphone 5s" go to summary tab in iphone preferences... . "what is this means?" "what i do????"

    itunes can not read the contents of the iphones "iphone 5s" go to summary tab in iphone preferences... . "what is this means?" "what i do????"

    Hello there, Choochg.
    The following Knowledge Base articles offer up some great steps for how to restore your iPhone:
    iOS: Back up and restore your iOS device with iCloud or iTunes
    http://support.apple.com/kb/ht1766
    and
    iCloud: Restore your iOS device from iCloud
    https://support.apple.com/kb/ph12521
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • Firefox does not print the target frame in PeopleSoft Enterprise or Campus Soultions Portals

    When using PeopleSoft Enterprise Portal or Campus Solutions Portal Firefox does not print the target frame. PeopleSoft utilizes iframes and has indicated this is the technology path they will follow. On each page is a header, footer, and left menu. Content is displayed in the target after it is selected from the left menu. This issue prevents users from using the standard print preview or print functionality.

    We need the standard print and print preview functionality that all of our end users are already familiar with to work. We have a large end user group that is frustrated this functionality is available in IE and Chrome, but not Firefox.

Maybe you are looking for

  • How do I delete text from a movie I did in final cut

    hey guys i made a movie in final cut a while back and I want to delete some text I added to a clip but I can't seam to figuer out how to do it anyone have any ideas? Message was edited by: the mac guy

  • Bank gurarantee and letter of credit

    Hi experts, how we can update the the bank gurarantee and letter of credit in SAP systems, Is i need any additional configuration ? regards, Sanju MS

  • Connection failed in OBIEE 11g

    Hi guys, I am trying to import data from database. but am facing error need to set environment variable. am using microsoft ODBC for oracle driver and also oracle 9i s/w. how to set the variables in adminstration tool? Is there any other problem? ple

  • Trouble with access database online

    Hello everyone, I created an applet that simply inserts data into an access database and then prints it out on the screen the sql insert statement. I signed the applet so I can trust it so I wont get any security errors. When I upload it to the site

  • PSE 12 Editor is not launching - Window opens and asks for registration

    I have PSE 12 (German Version) and had this successfully installed and working on my home desktop. End of January I moved to the US for some months and have installed my PSE 12 on my laptop (Win 8). I have moved the entire cataloque according to inst