Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7827305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:48:19+00:00 2026-06-02T09:48:19+00:00

I have celltable with 4 column (name size addedBy modifiedBy ) all the value

  • 0

I have celltable with 4 column (name size addedBy modifiedBy )

all the value is filled during the run time.

The table actully show the documents.

Documents can be pdf, txt , doc so

  1. i want to add icon before the name of the document.

  2. and i also want one more Image column before name column

My code so far.

*
private CellTable<FDocument> getDocumentTable() {
        if (documentTable == null) {
            documentTable = new CellTable<FDocument>();
            documentTable.setSize("600px", "300px");
            documentTable.addColumn(nameColumnD, "NAME");
            documentTable.addColumn(sizeColumnD, "SIZE");
            documentTable.addColumn(modified_by_ColumnD, "MODIFIED BY");
            documentTable.addColumn(dateColumnD, "MODIFIED ON");


        }
        return documentTable;
    }


TextColumn<FDocument> idColumnD = new TextColumn<FDocument>() {             
            @Override
            public String getValue(FDocumentobject) {
                // TODO Auto-generated method stub
                return object.getId();
            }
        };
        TextColumn<FDocument> nameColumnD = new TextColumn<FDocument>() {
            @Override
            public String getValue(FDocumentobject) {
                return object.getName();
            }
        };          
        TextColumn<FDocument> sizeColumnD = new TextColumn<FDocument>() {
            @Override
            public String getValue(FDocumentobject) {
                return object.getSize();                            
            }
        };
        TextColumn<FDocument> modified_by_ColumnD = new TextColumn<FDocument>() {
            @Override
            public String getValue(FilenetDocument object) {
                return object.getModifiedBy();
            }
        };
        TextColumn<FDocument> dateColumnD = new TextColumn<FDocument>(){
            @Override
            public String getValue(FDocumentobject){
                return object.getModifiedOn();
            } 
        };

 private void addValuesToTable(){
        List<FDocument> FDC = null;


        /*
         * Adding data to folder Table
         */
        ArrayList<FDocument> documentsArrayList = new ArrayList<FDocument>();
        Iterator<String> iteratorDocument = documents.getDocuments().getDocumentCollection().keySet().iterator();
        while(iteratorDocument.hasNext()){
            String key = iteratorDocument.next().toString();
            FDocument value = documents.getDocuments().getDocumentCollection().get(key);
            documentsArrayList.add(new FDocument(value.getName(), value.getSize(),value.getModifiedBy(), value.getModifiedOn(),value.getId()));

        }
        FDC = documentsArrayList;

    // Create a data provider.

        ListDataProvider<FDocument> dataProvider1 = new ListDataProvider<FDocument>();

    // Connect the table to the data provider.

        dataProvider1.addDataDisplay(documentTable);

    // Add the data to the data provider, which automatically pushes it to the widget.

        List<FDocument> listDocument = dataProvider1.getList();
            for (FDocument fDocument: FDC) {

                listDocument.add(fDocument1);
            }

This the way i have made my table and the value.

Plz any one tell me the procedure

  1. to add icon before the name of the document.

  2. and i also want one more Image column before name column

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T09:48:21+00:00Added an answer on June 2, 2026 at 9:48 am

    Use DefaultTableCellRenderer to set custom renderer against the column with the desired icon. As shown below, the renderer creates a new label to mask all the cells within the selected column.

    private class CellRenderer extends DefaultTableCellRenderer
    {
    
     public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
     {
        JLabel label = new JLabel((String)value);
        label.setOpaque(true);
        Icon icon = new ImageIcon("icon.png");
        label.setIcon(icon);
        return label;
     }
    }
    

    And then apply it to your table as shown below:

    table.getColumnModel().getColumn(0).setCellRenderer(new CellRenderer());
    

    Edited:
    If you’re using GWT then see here for an example code for Grid Cell format.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a celltable in GWT, I can change color of a specific column
I have a CellTable with one custom column where I render it manually and
I have 3 column + 10 rows in celltable. value1Column, value2Column, RecordState 1 |
I have a GWT CellTable<MyType> . This table have rows which should display a
I have a sortable column in a CellTable. The problem is that I have
I have a celltable which contains numbers in each column. Is there a way
I have a GWT CellTable - it's a pretty simple table with just a
I have a GWT two column display. The left column contains a CellTable with
I have two tables. Table A has a list of employee names. Table B
I have a Gwt celltable. Clicking on the headers sorts the columns properly. But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.