Multi line column JTable

Hi,
I am working on JTable and I am using DefaultTableModel.
I have a requirement that in one of the cells I need to show a multi line text which may contain 10 to 50 lines of text.I need to show all the text even on resizing the table.
Can anyone give me suggessions regarding this.
Thanks,
Bussa.

Hi,
Write your custom JTableCellEditor and Renderer to install a JTextArea on the cell you want.
You can set the size of the larger row separately via
JTable.setRowHeight(int row, int value); To display the full text you should set
JTextArea.setLineWrap(true);
JTextArea.setWrapStyleWord(true);and set the width of the JTextArea static.
after this calculate the height of the JTextArea and set it to the table.
Olek

Similar Messages

  • How to make multi-line report headings?

    Hi all,
    By default, Apex creates a single-line report heading for each column in a report.  To minimize white space, multi-line column headings are sometimes appropriate.  How can Apex be directed to split a column heading at certain place(s)?
    Thanks,
    Kim
    P.S. I'm running Apex 4.2.2. 

    See https://forums.oracle.com/message/11154533

  • Copy multi line oftext from enhanced to plain retreives HTML

    Hi,
    I have two multi line columns, one in enhanced mode and one plain text. when i use quick view to copy all the values from enhanced to plain, it paste all the html tags alongside the text.
    Any thoughts how to eliminate that and copy only the text?
    Thanks a lot in advance

    Hi,
    You can edit list items in DataSheet view and copy items.
    Thanks,
    Vivek
    Please vote or mark your question answered, if my reply helps you

  • Change title to multi-line type?

    I am reading that it is not possible to change the Title field to a multi-line column type.  I have created a Question/Answer list. I renamed the Title field to "Question", but I need the user to be allowed more than 255 characters. 
    Is there a way to do this?  I know I can create a new column, but I need it to link to the item view/edit pages.
    There are no mistakes; every result tells you something of value about what you are trying to accomplish.

    Hello,
    What version of sharepoint you are using? If you are using SP 2010 or later then use "LinkToItem="TRUE"".
    This will add link to any column in list.
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/6efa16c5-a7c4-499f-9928-90cc868ffddb/make-title-column-more-than-255-characters?forum=sharepointdevelopmentprevious
     If you are using legacy version then i think you can try this: (i have not tried it)
    http://www.ilovesharepoint.com/2008/08/add-sharepoint-list-item-context-menu.html
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Multi-line JTable headers?

    Is there any way for a JTable column header to have 2 or more lines of text? I want narrow columns with fairly lengthy text descriptions.
    The only thing I could think of was to override AbstractTableModel.getColumnName to send String values with embedded "\n" or html "<br/>" constructs. Neither method works.

    I'm sorry, my earlier statement was not precise enough.
    The technique you show does produce multi-line header text; however the height of the header is unchanged, so only the center line is visible (or the bottom of line 1 and the top of line 2, if two lines are written).
    Do you know if the height of the header row can be changed?

  • How to present a Column which includes multi lines

    Hi,
    In Oracle BI Publisher 11g, I'm trying to present a column which includes a long string with <CR>.
    Like an Example:
    abc
    def
    ghi
    But, It presents the all sting in one line like:
    abcdefghi
    How can I present it as its stored in the Database?
    Thanks.
    Edited by: Hadar on Feb 18, 2011 6:55 AM

    Thanks BipUser,
    This is not the same issue.
    I'm Talking about a column which includes multi lines.
    When I select it from SqlPlus:
    Select col1 From Tab1 Where rownum <2;
    I got:
    abc
    def
    ghi
    But, from Bi Publisher I got:
    abcdefghi
    Why? and how Can I Present it as it saved in Database?

  • Reading a semi column delimited multi line Flat file on KM repository

    Hi,
    I have a requirement in our project to read a multi line, semi column delimited flat from kept on the Knowledge Management repository and display the contents in the Portal.
    I had tried couple of options and was unable to read the file. I am not sure which are the correct APIs I should be using.
    Can any one of the experts could guide me with the sample code, that will be great!
    Your early response is highly appreciated.
    Regards
    Venkat

    here you go.
    //******* Read file from KM
    String repository_km;
    String FileURL;
    repository_km="/documents/data/data.txt";     
      try
    //Getting the user......
      IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
      IUser sapUser = wdClientUser.getSAPUser();
      com.sapportals.portal.security.usermanagement.IUser ep5User =
      WPUMFactory.getUserFactory().getEP5User(sapUser);
    //Getting the Resource.........
      IResourceContext resourseContext = new ResourceContext(ep5User);
      IResourceFactory resourseFactory = ResourceFactory.getInstance();
    //path to the KM Folder ("/documents/data/data.txt")
      RID rid= RID.getRID(repository_km);
      com.sapportals.wcm.repository.IResource resource =
      resourseFactory.getResource(rid, resourseContext);
    if (resource != null)
         String text = "";
         BufferedReader in = new BufferedReader(new InputStreamReader(resource.getContent().getInputStream()));
         int count=0;
         while ((text = in.readLine()) != null)
         strText[count] =text;
         count++;
    catch (RuntimeException e2) {
    wdComponentAPI.getMessageManager().reportException("Error in reading file from KM : "+e2.getMessage(),true);
    //                  TODO Auto-generated catch block

  • How to create a multi-line table/column comment

    Can someone tell me how to create a multi-line table or column comment?
    Apparently, the concatenate operator (||) does not work with the COMMENT statement.
    I've searched the Oracle manuals and couldn't find an answer.
    COMMENT ON TABLE sometbl IS 'i would like to break up this comment into several lines in order to improve readability'; Effectively, this is what I'd like to do (but it doesn't work):
    COMMENT ON TABLE sometbl IS
      'i would like to break up ' || CHAR(10) ||
      'this comment into several lines ' || CHAR(10) ||
      'in order to improve readability' || CHAR(10); Oracle version is 10.2.0.4

    Why not just
    SQL> create table t (a int)
    Createtable successfully completed.
    SQL> comment on table t is 'i would like to break up 
    this comment into several lines 
    in order to improve readability'
    Commenton successfully completed.
    SQL> select * from user_tab_comments where table_name = 'T'
    TABLE_NAME           TABLE_TYPE  COMMENTS                               
    T                    TABLE       i would like to break up               
                                     this comment into several lines        
                                     in order to improve readability        
    1 row selected.?

  • Print JTable with multi line header

    I need to print a JTable with multi line header, I want to know if I can use the method jTable.print(int, MessajeFormat, MessageFormat) by manipulation of the MessageFormat. How I can manipulate it?
    Otherwise, How I can print this?

    hi again,
    To print pdf in a swing application you don't need servlet.jar.
    You'll only need itext.jar and a printer connected to your pc.
    Download the iText source code and unzip it. See the following classes:
    com.lowagie.tools.LPR and com.lowagie.tools.BuildTutorial. This latter is the main class of a swing tool that you can run.
    Silent Print:
    You have only to embed this javascript code in your pdf:
    writer.addJavaScript("this.print(false);", false);
                        document.add(new Chunk("Silent Auto Print"));Then, you have to send the document to the printer.
    Google : java print pdf
    http://forum.java.sun.com/thread.jspa?threadID=523898 or
    http://www.exampledepot.com/egs/javax.print/pkg.html for printing task.
    Under unix system, I used this:
                           String PRINTER = ...;
                   try {
                        String cmd = "lp -d " + PRINTER + " " + PDF_PATH;
                        Runtime.getRuntime().exec(new String[] { "sh", "-c", cmd });
                   } catch (Exception e) {
                                 //handle the exception
                                 e.printStackTrace();
                   }hth

  • Multi-line Labels in Swing 1.1?

    Hi
    Is it possible to get multi-line labels
    (using any type of component) prior
    to 1.1.1?
    Marc

    I think you should create a custom table cell renderer. As I am a lazy one I'd subclass a default renderer as follows (I have not tried it, it's just a clue):
    public class MultilineTableCellRenderer extends DefaultTableCellRenderer
         private JTextArea renderer;
         public MultilineTableCellRenderer()
              renderer = new JTextArea();
              renderer.setEnabled(false);
              // You should find out another color constant if you are using
              // Java L&F, this works with the Windows L&F.
              renderer.setDisabledTextColor(UIManager.getColor("control"));
         public Component getTableCellRendererComponent(JTable table,
              Object value, boolean isSelected, boolean cellHasFocus, int row,
              int column)
              JComponent compo = (JComponent) super.getTableCellRendererComponent(
                   table, value, isSelected, cellHasFocus, row, column);
              renderer.setBackground(compo.getBackground());
              renderer.setForeground(compo.getForeground());
              renderer.setDisabledTextColor(compo.getForeground());
              renderer.setBorder(compo.getBorder());
              // Might need something like that.
              /* renderer.setText(value.toString() ???); */
              return renderer;
    }You might want to stub out methods like repaint, validate for better performance in a JTextArea subclass...
    Kurta

  • Multi line issue in Table Cell Editor

    Hi,
    I am developing an occasionally connected application for handheld devices using NetWeaver Mobile 7.1. In one of the view, I have a table which display items information from the data source. In one of the column I need to display item description so I used TextEdit in the Cell Editor to display the information in multi line format and also wrapping is enabled.
    But during testing of the application the TextEdit control does not wraps the text and as well as only first line of TextEdit control is visible inside the table and rest of the rows are not visible because of table's row height is not adjusted to the TextEdit control. I couldn't find any option to vary the size of the row height of the table.
    Please suggest a solution to bring multi line display with in the table.
    Also, check out my other issue posted here.
    [Issue in wrapping of text in TextEdit control|Issue in wrapping of text in TextEdit control]
    Thanks in advance.
    Regards,
    DVR.
    Edited by: Vinodh Raj D on May 28, 2009 8:18 AM

    Hi Vinodh,
                   Mutliline text in a text view/edit control inside a table cell is not supported.
    You can view multiline text in a text view/edit as a seperate control inside a view. I think in case you want to see the whole address you can create a detail(s) view which can be navigated from the list (table) view.
    Regards,
    Nipun

  • How to create a dynamic multi-line function in SQL Server

    I am attempting to create a Multi-Line Function in SQL Server that accepts a dynamic WHERE clause as a parameter. I need this so that the function can be as versatile as possible for the filter that needs to be applied. I am unfortunately getting an error
    upon creation of the function.  I don't know how to solve the problem. Can someone advise me?
    SQL:
    SET
    ANSI_NULLSON
    GO
    SET
    QUOTED_IDENTIFIERON
    GO
    -- =============================================
    -- Author:
    -- Create date: 2/3/2014
    -- Description: This multiline function will accept a generic WHERE Clause and apply it to the query for return.
    -- =============================================
    CREATE
    FUNCTIONTESTMULTILINEFUNCTION
    @WHEREvarchar(1024)
    ,@CHANGEDDATEasdatetime
    RETURNS
    @TESTTABLE
    TABLE
    IDint
    ,REVint
    AS
    BEGIN
    Declare@SQLSTRINGvarchar(4096)
    SET@SQLSTRING=''
    SET@SQLSTRING=@SQLSTRING+'SELECT
    REVS.ID, REVS.Revision
    FROM
    Select distinct result.ID, Max(Rev) as ''''Revision''''
    FROM
    Select * from dbo.BugsAll
    where
    [Changed Date] < @CHANGEDDATE
    ) result
    GROUP BY result.ID
    ) REVS
    join dbo.BugsAll BA on (BA.ID=REVS.ID AND BA.REV=REVS.revision)'
    IF
    (@WHEREisnotnullOR@WHERE<>'')
    BEGIN
    SET@SQLSTRING=@SQLSTRING+'
    WHERE '+@WHERE;
    END
    INSERT@TESTTABLE
    EXEC
    (@SQLSTRING)
    RETURN
    END
    GO
    ERROR:
    Msg 443, Level 16, State 14, Procedure TESTMULTILINEFUNCTION, Line 44
    Invalid use of a side-effecting operator 'INSERT EXEC' within a function.
    Senior Test Lead -- Microsoft

    >> Unfortunately I really need to form a dynamic query in a table valued function on the SQL SERVER. I have another tabled valued function that needs something returned as a table in order to further join the data. I am not allowed to use Stored
    Procedures in that function. <<
    You do know that real SQL programmers hate the proprietary nightmare of tabled valued functions?  This is how you procedural programmers avoid learning set-oriented declarative and functional programming. 
    Your mindset wants to write to a scratch tape or disk file (aka “tabled valued function result table”) just like you did BASIC, FORTRAN or COBOL. QL programmers do not have to materialize their data. We can use VIEW or a drive table as well as a base table. 
    >> Plus, there are occasions where I don't want to pass in a field [sic: columns are not fields] parameter or need to change a parameter list such that I don't wish the table function to filter by a particular field [sic] or other setting. <<
    What you want is a magical “Automobiles, Squids and Lady Gaga” function. An SQL programmer might write a complex VIEW then do simpler SELECTs off it. 
    >> My application pushes the WHERE clause from EXCEL to SQL to do the hard work as EXCEL is not the application in which I want to process the SQL statement and pass it via ODBC. I cannot run macros in Excel on the web.<< 
    This is a crazy language system. Usually we fetch data in SQL and then pass it to a math package, report writer, etc. We never keep logic (aka WHERE clauses) outside the database. 
    >> I am bummed about the fact that this feature doesn't work. It will up my server management costs to maintain unique tabular based functions based on WHERE clause query <<
    So stop writing those “tabular based functions”, change your mindset and start learning SQL and do it right. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • New lines created in excel when displaying multi-line text item value

    Hi all,
    I put the value of a multi-line text-item into a csv file :
    DECLARE
    file_filter VARCHAR2(256) := 'Export Files (*.csv)/*.csv/All Files (*.*)/*.*/';
    fExp VARCHAR2(256);
    in_file Text_IO.File_Type;
    linebuf VARCHAR2(4000);
    BEGIN
    fExp := get_file_name ( directory_name, file_name, file_filter, NULL, SAVE_FILE, TRUE);
    IF fExp IS NOT NULL
    THEN
    set_application_property(cursor_style,'BUSY');
    in_file := Text_IO.Fopen( fExp, 'W');
    linebuf := NVL(:com_bnc_possibles.LIBEL_TRAITE,'') || ';' ||
    NVL(:com_bnc_possibles.NUM_ANFR_ID,'') || ';' ||
                             NVL(:com_bnc_possibles.ver_fiche,'') || ';' ||
                             NVL(:com_bnc_possibles.titre,'') || ';' ||
    NVL(to_char(:com_bnc_possibles.date_creat, 'dd/mm/yyyy'),'') || ';' ||
    NVL(to_char(:com_bnc_possibles.date_valide, 'dd/mm/yyyy'),'') || ';' ||
    NVL(:com_bnc_possibles.LIBEL_STATUT,'') || ';' ||
    NVL(:com_bnc_possibles.label_reg,'') || ';' ||
    NVL(:com_bnc_possibles.nom,'') || ';' ||
    NVL(:com_bnc_possibles.prenom,'') || ';' ||
    NVL(:com_bnc_possibles.nom_societe,'') || ';' ||
    NVL(:com_bnc_possibles.comp_bnc,'') || ';' ||
    NVL(:com_bnc_possibles.motifs,'') || ';' ;
    Text_IO.Put_Line( in_file, linebuf);
    Text_IO.Fclose( in_file);
    set_application_property(cursor_style,'DEFAULT');
    END IF;
    END;
    And when I opened the csv file then the remaining lines , that is from the second line , of the column "motifs" are displayed through the column A of excel. The "motifs" multi-line text-item has 500 as its Maximum Length property value, and has a Char Data Type property value.
    So how to display all the motifs' lines through the same column M without displaying the remaining lines in column A ?
    Or are there tips to remove CHR(13) characters from a multi-line text-item ?
    Thank you very much indeed.
    Message was edited by:
    andrianiaina

    Hi,
    I tried to do it in different way. What i did is I have created a item of type formattted text and set its text like:--
    <html>User authentication failed. <br*> Cause: Invalid password.</html> --remove *
    So I am able to see the prompt like :-
    User authentication failed.
    Cause: Invalid password.
    Hope this helps you...
    Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Displaying Multi Line Text

    Hi,
    I am having issues in displaying multi line text on a Text Item. Basically there is data in the database column DetailText which is stored like this with carriage returns :
    If I look at the column in Toad it is formatted with all the carriage returns correctly eg.
    Hello
    World
    When I display this in my StaticStyled Item it displays like "Hello World" in one line. I want to be able to display it as it is with the carriage return on 2 seperate lines.
    I have looked in this forum and one search 2 places and one suggestion was to use RawText Item type. I have tried changing the Item Type to Raw Text and FormattedText but it doesn't make any difference. The lines are still displayed horizontally instead of vertically. Another place I saw was to use OAHTMLWebBean but doesn't show how I can do this.
    This should be simple enough but I have searched the DevGuide and this forum and couldn't figure out the solution. Any help would be appreciated.
    Thanks

    Hi,
    I tried to do it in different way. What i did is I have created a item of type formattted text and set its text like:--
    <html>User authentication failed. <br*> Cause: Invalid password.</html> --remove *
    So I am able to see the prompt like :-
    User authentication failed.
    Cause: Invalid password.
    Hope this helps you...
    Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Feature request : import of multi-line notes in CSV or tab-delimited file

    This is a feature request to the AddressBook development team:
    Following a question posted here and asked to support (thanks to Barry and Julia from ADC), it turns out that AddressBook is not ready yet to import multi-line notes from a CSV or tab-delimited file.
    I would like to kindly suggest the AddressBook development team to update the import methods for such flat files to parse the text of what is assigned to the Notes field, and convert documented escape sequences to their pre-determined corresponding special character.
    I would think that the following would be pretty easy to implement, and easy for the targeted audience (enthousiasts power-users and up) to remember:
    "\n " : mark a new line (same as ^p in Word)
    "\t " : replace by a tab
    I would keep the trailing space to avoid problems with DOS-type file path problems.
    and of course...
    "\\n " and "\\t " for whoever would want to import notes about \n and \t
    For example, in a Notes column, the text:
    "Escape sequence \\n :\n move the text to a new line\n \n while escape sequence \\t :\t move the text to the next horizontal tab"
    would give the following (just consider text between <Note> marks):
    <Note>
    Escape sequence \n:
    move the text to a new line
    while escape sequence \t: move the text to the next horizontal tab
    </Note>
    Thanks for reading...
    Frédéric Denis

    The developers do not necessarily read these USER discussion pages. If you want to make suggestions and know they will be read (which is at least a step towards implementation) use the OS X feedback page.
    AK

Maybe you are looking for

  • Newbie questions on Admin, Deployment & Answers

    Hi Gurus, Sorry to be raising questions that may have been repeated over again. I tried to search thru the net/forums but cudn't find anything useful. Really wud appreciate any help/directions/links to the answers I seek Developement and Production P

  • Apple tv text and pictures have a green hue

    Ok, I was reading through the forums and I keep seeing people talk about a green screen but I am not having that issue.  Everything on my apple tv is in a green and black hue.  I can see the words and picutres and everything but they are all green. 

  • Who can i use a giftcard in other countries ?

    I bought a spotifygiftcard in the netherlands now im in france and cant use it. What can I do

  • MI Client 7.0 startup classpath problem

    hi experts, I have installed jdk1.5.0_11 and MI Client 7.0 on my system. Now when-ever i try to start my client it shows me an error "Time out 61, cannot connect to server ". I have run the  "startup.bat"  file in cmd and it shows following trace. C:

  • No possible to seek with timeline in a song

    the music-app on my nokia c7 is really perfect. -old, not supported but really useful with many functions. But on the sony walkman i still miss the timeline function to seek and listen in a song. why isn't it possilbe like other (free) apps?