How to print the table in java.

we want to take the print out of JTable in java.
But we have some other components on the GUI
alongwith the JTable.Now our query is that how cud
we take the print out of JTable only?
we are using jdk1.4.2 version of java.In this version
we don't have any direct method of taking the print out
of JTable.
Any valuable suggestion will be appreciated.
Thanks.

You don't have to use a reporting tool:
http://java.sun.com/docs/books/tutorial/2d/printing/in
dex.html
Okie! Thats only a suggestion. Im sorry.

Similar Messages

  • How to print the table values in fastest way?

    Dear Friends,
    I'm having table in my application and i need to print the table values. For that I used print() method to print the table values.
    boolean complete = tableObj.print(mode, header, footer, showPrintDialog, null, interactive,
                                  null);But, the time taken for displaying print dialouge box so late and printing operation is done very slowly.
    Could anyone please tell me is there any better way and fastest way to print the table values?
    Thanks in advance

    Hi,
    In the Module pool you will have fields. For those fields you have created the name also. Assign those name to work area and from there to internal table.
    And for your requirement viceversa you need to done.
    With Regards,
    Sumodh.P

  • How to print the table

    We have to take a print out of a JTable having data.
    But our problem is that , we have some other components on that
    page also.
    and we don't want to take the print out of that components.
    we want some solution in order to take the print out of that
    JTable only.
    we want to eliminate that components from the printing page.
    plz,provide some good solution in this regard as soon as possible.

    In Java 5, it can be done with one line of code:
    table.print();
    http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JTable.html#print()
    */

  • HOW TO PRINT  THE EXCEL CELL COMMENT IN JAVA SWING FRAME ?

    How to print the excel cell comment in java swing frame
    user can print the data of cell with comment in bracket in java swing frame.
    please make one java code to read an excel spreed sheet and print the output in Java swing frame as follows
    EMP NO - 1, 2, 3
    EMP NAME - aname (amitesh:very good), bname (amitesh: average), cname (amitesh: very bad)
    EMP AGE - 11, 22, 33
    EMP DESG - ad, bd, cd
    Note: the bracket portion is the excel comments put in that cell

    hello everyone i'm new to this forum..how are you all...
    Jack Brosnan
    [mobile phone|http://www.mobilephonesforsale.net.au/apple-iphone-f-2.html]

  • How to print the image data stored in object of 'java.io.File' Class in jsp

    I have created a file object for the image file in the system temporary directory.Now I want to display it in my page. please tell,How to print the image data stored in object(in my program it is imgr) of 'java.io.File' Class in jsp

    Create a servlet which gets an InputStream of the file and writes it to the OutputStream of the response and call this servlet in `src` attribute. That's basically all.
    Here's an example which covers the most of the minimum needs: [http://balusc.blogspot.com/2007/04/imageservlet.html].

  • How to print the text in points wise in sap script

    hi friends,
    how to print the text in points wise in sap script.
    ex: if suppose paragraph consists of 15 lines. then according to one sentence or one fullstop (.) it should give point 1. like that...
    1. hai how ru.
    2. what r  u doing.
    3.where r u.
    like this i want numbering.. waiting for ur replys.
    thanks,
    kiran

    declare a counter
    data : cnt type char 4.
    print :
    cnt = cnt + 1.
    &cnt& &text&
    cnt = cnt + 1. and so on.
    or.
    if the data is in an internal table
    loop at internal_table.
    cnt = cnt + 1.
    write form.
    in script -&cnt& &text&
    endloop.
    Edited by: NIKHILKUMAR POOJARI on Nov 17, 2008 11:18 AM

  • How to print a text in java?

    How to print a text in java?

    of corse, i have JTextField in my frame that i want to extract the text and print it on a paper with a printer.

  • How to print the file name in sap

    Hi All,
    I have requirment like,
    there is a folder in my local system, inside that folder there are 10 Excel file like file1.xls,file2.xls..............file10.xls
    how to print the file name of all these file in SAp like
    file1.xls
    file2.xls
    file3.xls
    file4.xls
    file10.xls
    Appropriate points will be rewarded.
    Thanks in Advance
    Arun kumar

    Hi,
    Still you are facing any problem with this code expalin the problem with details , otherwise close this thread.
    Use Method <b>cl_gui_frontend_services=>directory_list_files</b> to read file names for a given directory
    after reading the files then Use FM : <b>RSPO_SX_OUTPUT_TEXTDATA</b> to create spool from internal table data and print the data.
    <b>sample code :</b>
    data: desktop_dir type string.
    data: ifiles type table of string.
    data: xfiles type string.
    data: count type i.
    data: filepath type string.
    call method cl_gui_frontend_services=>get_desktop_directory
      changing
        desktop_directory    = desktop_dir .
    call method cl_gui_cfw=>flush.
    call method cl_gui_frontend_services=>directory_list_files
      exporting
        directory                   = desktop_dir
    *    filter                      = '*.xls'
         files_only                  = 'X'
    *        DIRECTORIES_ONLY            =
      changing
        file_table                  = ifiles
        count                       = count.
      DATA : x_name       LIKE tsp03d-name,
             x_dest       LIKE tsp03d-padest VALUE 'LOCL',
             x_rows       LIKE sxpcklsti1-body_num VALUE 0,
             x_startrow   LIKE sxpcklsti1-body_start VALUE 1,
             x_pages      LIKE rspotype-pages VALUE 1,
             x_pages_1    TYPE p DECIMALS 2,
             x_rqtitle    LIKE sxpcklsti1-obj_descr,
             x_rqcopies   TYPE i VALUE 1,
             x_rqowner    LIKE trdyse01cm-username,
             x_immediate  LIKE pri_params-primm VALUE ' ',
             x_rqid       LIKE tsp01-rqident,
             i_contents    LIKE  solisti1 OCCURS 0 WITH HEADER LINE,
          x_pages   = 1.
          x_rqowner = sy-uname.
          x_dest     = 'LOCL'.
          x_startrow = 1.
          x_rqcopies = 1.
          x_immediate = 'X' .
          CALL FUNCTION 'RSPO_SX_OUTPUT_TEXTDATA'
           EXPORTING
    *       name                 =   x_name
             dest                 =  x_dest
             rows                 =  x_rows
             startrow             =  x_startrow
             pages                =  x_pages
             rqtitle              =  x_rqtitle
             rqcopies             =  x_rqcopies
             rqowner              =  x_rqowner
             immediately          =  x_immediate
           IMPORTING
             rqid                 =  x_rqid
           TABLES
             text_data            = i_contents
           EXCEPTIONS
             name_missing         = 1
             name_twice           = 2
             not_found            = 3
             illegal_layout       = 4
             internal_error       = 5
             size_mismatch        = 6
             OTHERS               = 7.
          IF sy-subrc <> 0.
    ** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    **         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    Regards
    Appana
    *Reward Points for helpful answers
    Message was edited by: L Appana

  • 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);
    }

  • How to print the page in custom format

    Hi All,
    I've a login page like
    USER ID : Test box to enter data
    PASSWORD: Text Box to enter data
    A Button named as Print
    When i click on print button i want to print the form in custom format. when i use window.print in java script it is printing text boxes and button . but i dont want to print button and text boxes. i just want to print the user id and password entered by the user with corresponding labels.
    Can anyone suggest me how to print the page in the above format with out using the request object. coz i need to implemnt above with plain java script and html.
    Tks in Advance

    Use CSS. Check out the 'media' attribute. http://www.w3.org/TR/REC-CSS2/media.html

  • Hi gurus  in BDC how to print the header on the top of the data

    hi gurus  in BDC how to print the header on the top of the data

    hi,
    while downloading the file using gui_download function module
    in that function module in  TABLES  filednames parameter is used to get headings
    example:
    CALL FUNCTION 'GUI_DOWNLOAD'
         EXPORTING
      BIN_FILESIZE                    =
           FILENAME                        = FILENAME1
          FILETYPE                        = 'ASC'
          WRITE_FIELD_SEPARATOR            = 'X'
         TABLES
           DATA_TAB                        =   T_ZETBR
          FIELDNAMES                       = IT_HEADER
    reward if useful,
    thanks and regards

  • HOW TO PRINT THE MATTER IN FOR ALL ENTRIES

    HI HOW T  PRINT THE FOR ALL ENTRIES MATTER

    Hi Naresh,
    You can only use FOR ALL ENTRIES IN ...WHERE ...in a SELECT statement.
    SELECT ... FOR ALL ENTRIES IN itab WHERE cond returns the union of the solution sets of all SELECT statements that would result if you wrote a separate statement for each line of the internal table replacing the symbol itab-f with the corresponding value of component f in the WHERE condition.Duplicates are discarded from the result set. If the internal table itab does not contain any entries, the system treats the statement as though there were no WHERE cond condition, and selects all records (in the current client).
    For example:
    SELECT * FROM sflight INTO wa_sflight 
    FOR ALL ENTRIES IN ftab 
    WHERE CARRID = ftab-carrid AND 
                 CONNID = ftab-connid AND 
                     fldate = '20010228'. 
    This condition, return all entries of the sflight.
    When using FOR ALL ENTRIES the number of matching records is restricted to the number of records in the internal table. If the number of records in the database tables is too large then join would cause overheads in performance. Additionally a JOIN bypasses the table buffering.
    Thanks,
    Reward If Helpful.

  • How to print the texts retrived by using READ_TEXT fun module in Smartform

    Please tell me how to print the text which is rertrived by using the READ_TEXT function module in smartform.
    I have coded all things in the program lines and in that i am retriveing the long texts.
    I am getting the text lines in my internal table clearly, the thing is that I am not able to pass these lines to the text.
    I have to print the trouble ticket. in that the notes log I have to pass.
    its urgent. Points will be rewarded for any type of clue. whether it will work or not.

    There are a few ways to do it. If you need to take all of the text in the text type, in your SF text element choose "Include Text".
    Populate the fields with the data that corresponds to the text type. It is similar to the interface to the FM "Read_Text.
    Text Name
    Text Obje
    Text ID 
    Language
    Encase any variables with the "&" symbol.
    If you have already coded the call to the FM "READ_TEXT" and loaded the text into an internal table, create a loop and loop through the itab. Inside of the loop create a text element and add a variable in the text element for the field you are looking to output.

  • In cursor i have two queries where put the condition and how to print the d

    hi i have 2 tables 1 is emp(empid,empname,dept,grade)
    2 is salary(grade,salary)
    in cursor when ever grade is increased salary automatically increased
    in 2 diffrent queries where i will put the if condition and how to print the output.
    any one can please suggest me.
    finally my required out put is
    empid,empname,grade,salary
    thanks

    It is always helpful to provide the following:
    1. Oracle version (SELECT * FROM V$VERSION)
    2. Sample data in the form of CREATE / INSERT statements.
    3. Expected output
    4. Explanation of expected output (A.K.A. "business logic")
    5. Use \ tags for #2 and #3. See FAQ (Link on top right side) for details.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to Create adf table from java bean

    Hi,
    How to Create adf table from java class (Not from ADF BC).
    Thanks
    Satya

    @vlsn -- you have to follow what shay said.
    Do the following in Model layer ::
    create a table property java class with your columns setters and getters like :
    *public class gridProps {*
    private int sno;
    private String orderNum;
    *public void setSno(int sno) {*
    this.sno = sno;
    *public int getSno() {*
    return sno;
    *public void setOrderNum(String orderNum) {*
    this.orderNum = orderNum;
    *public String getOrderNum() {*
    return orderNum;
    Create another table java class which will populate the values to your column values and return the collection :
    *public class gridPopulate {*
    private  List<gridProps> gridValues ;
    *public List<gridProps> setToGrid(ArrayList<ArrayList> valuesToSet) {*
    *if (valuesToSet == null) {*
    return gridValues;
    gridValues = new ArrayList<gridProps>();
    if(btnValue.equals("completeBtn"))
    return gridValues;
    for(ArrayList<String> tempArr:valuesToSet)
    gridProps gp = new gridProps();
    gp.setSno(Integer.valueOf(tempArr.get(0)));
    gp.setOrderNum(tempArr.get(1));
    return gridValues;
    Right click gridPopulate class and create this as data control.This class will be seen in Data control list.Under this data control,Drag the grid property collection(created earlier) to your page.Then execute your binding(gridPopulate) according to your logic.
    Thanks.(My jdev version 11.1.1.5.0)

Maybe you are looking for