Text that spans more than one cell in a JTable

Hi all.
I have a JTable where I've altered the renderer so that it looks like I have columns that span more than one cell.
e.g.: http://i.imgur.com/RSGOh.png
From that image though you will notice that the text (which is based in a JLabel) is truncated.
I need this text to span the available cells so was wondering about the best way of doing it.
I could:
1) When I know that the text won't fit, don't draw anything at all with the renderer but make a note of it and then in the paintComponent method of the JTable, paint the text in the appropriate position once the rendering has been done.
2) Provide a custom renderer that draws as much of the text as possible up to the right edge, and then have an adjacent cell renderer paint the rest.
3) Use a different TableUI that when I know I need to span, uses a special renderer to stamp over the spanned cells...
4) other methods???
I was going to attempt choice 1) but thought I'd ask here first in case someone has had experience in this and knows the "correct" way to do it.
Is this the right way to go about it?
Thanks, Nick.

// Allow selection to span one contiguous set of rows, visible columns, or block of cells
table.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
// Allow multiple selections of rows, visible columns, or cell blocks
table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);

Similar Messages

  • Why can't I send a text message to more than one contact?

    With all my previous cell phones I was able to send a single text message to more than one contact. With the iPhone I can only send to one contact and then I have to type the text message again and send to another contact, and so on. Or am I messing a fuction on the iPhone that allows for sending a text message to more than one contact?

    No, you are not missing it. That feature is not available on the iPhone.

  • Tables with more than one cell with a high number of rowspan (ej. 619). This cell can not be print in a page and it must be cut. But I don't know how  indesign can do this action.

    Tables with more than one cell with a high number of rowspan (ej. 619). This cell can not be print in a page and it must be cut. But I don’t know how  indesign can do this action.

    set the wake-on lan on the main computer
    The laptop's too far away from the router to be connected by ethernet. It's all wifi.
    No separate server app on the laptop, it's all samba
    The files are on a windows laptop and a hard drive hooked up to the windows laptop. The windows share server is pants, so I'd need some sort of third party server running. Maybe you weren't suggesting to use Samba to connect to the windows share though?
    I'm glad that you've all understood my ramblings and taken and interest, thanks The way I see it, I can't be the only netbook user these days looking for this kind of convenience, and I certainly won't be once chrome and moblin hit the market.
    Last edited by saft (2010-03-18 20:38:08)

  • Sending a Text Message to More Than One Person...

    How do i send a single text message to more than one person? Is that possible?

    Not possible at present. It's on the list of feature requests. We hope an update will add this feature in the near future.

  • If-function for more than one cell

    Hello friends,
    I am looking for an if-function that asks for more than one cell. EG:
    =If(A2=True;50;0) were A2 is a marker field. In my table A3, A4 and A5 are markerfields as well. How do I add those cells to my my function. Saying: Is any of A2-A5 true, than say 50 else say 0.
    As a second question:
    Is there a function that says: If A2 is true give me 50, if A3 is true gimme 40 ... all in one function!?
    Thanks a lot for helping me !!
    Jimmy

    The answer to both is yes you can perform these using functions that exist in Numbers:
    1) You can use check boxes for the marker cells then use cells in the next column to translate from check boxes to a numeric value:
    e.g. B2 = if(A2=TRUE, 1, 0)
    then sum the cells in B2 - B5 and compare to 0.  if the sum is greater than zero then one of the check boxes is checked:
    2) The question with this request is what if more than one marker is set (again I am assuming you are using check boxes)
    I am assuming the A2 take precedence (that is if the checkbox for A2 is checked that the result will be 50 EVEN if A3 is checked)
    A1 = IF(A2=TRUE, 50, IF(A3=TRUE, 40, 0))

  • How to add the rows formatted as table headings, Tables headings are repeated when a table spans more than one page.

    Hi all,
    i am facing problem while generating Test Result word document after successful execution of TestStand.
    The Problem is :
    i want to add rows Formatted as table headings, table headings are repeated when a table spans more than one page(marked as Red).
    Example:
    Page  No. 1
    |     Test case Number  |  Test Step number      |
    |      100                         |            100                   |
    Page  No. 2
    |     Test case Number  |  Test Step number      |
    |      200                         |            300                   |
    Test Result word document should generate with Table headings(marked as Red) in every pages of the document, but i am not getting as per above example.
    Please through light on this.
    Regards,
    Susa.

    Hi Santiago,
    Thank you very much for your valuable reply.
    i want to generate MS-word report for TestStand after successful testing using MS-word2000.
    Test report contains Actual values, Expected values and Pass/Fail status.
    In my program i have customized all  fields i can able to generate test report which contains Verification engineer name , test mode, test date, start time, end time Actual values, Expected values and Pass/Fail status.etc....
    To put all values of test case number, Test step number, Actual values, Expected values and Pass/Fail status in to table for each time, i will
    insert a row into table every time values arrives, once the table exceedes its page size it moves to the next page, next page should start with table row header  but it start with  values of above said parameters.
    so i'm not able to repeat table row header for each page.
    Please find the attached file for your reference.
    Attched file expected.doc  :   This file contains what i wanted to generate MS-word report. Here table row header "Test Case Number and Test Step Number " is repeated in second page.
    Attached file Actual output from source code.doc   :  This report generated from the source code. Here table row header "Test Case Number and Test Step Number" is not repeated in second page.
    Do you know any property to set "repeat as header row at the top of each page" using MS-word ActiveX in CVI/Labwindows.
    i think this information is sufficient for you,
    Still if you need some information please ask me.
    Thanks
    Susa.
    Attachments:
    Actual output from source code.doc ‏25 KB
    expected.doc ‏26 KB

  • I am trying to copy more or less 30G from my MacbookPro to an external hard drive and it is stuck in the "preparing to copy" step. But that for more than one hour. What should I do to make it faster? Thanks a lot in advance!

    I am trying to copy more or less 30G from my MacbookPro to an external hard drive and it is stuck in the "preparing to copy" step. But that for more than one hour. What should I do to make it faster? Thanks a lot in advance!

    Thanks Shootist007, by blockd files I mean files that I have changed to blocked and when I tried to move then for the first time, I had to unblock again. I am trying to backup my pictures, my songs and other files like word documents and excel tables. First I put all of them as blocked, what caused the first problems on trying to move them. Then, I've unchecked the block option and if I try to move one by one, there is no problem. The issue is to move all together, because it gets stuck in the preparing to copy files step. Anyway, if I cannot do all by once, I'll do it one by one, event though that was not suposed to happen if we are talking about technology, right? Anyway, I thank you again for trying to help me!

  • In Music, sometimes an album that has more than one artist, only one shows up, how do I get them all that are all on the album to play in sequence when I select that album?

    I can't figure out why, on my ipod touch in Music, when I select some albums that have more than one artist, the whole album doesn't come up to play all together.  This happens in some compilations, and only ne song shows up from each artist on the album.  Or like on an artist's album that has someone else singing with her.  I get that they are on the same line as an artist, but the album is an album, and when you play an album, the whole thing should play - right?  Thanks for your help!

    Generally all you need do is give tracks from the same album a common Album Artist. See Grouping tracks into albums. The images need an update but the basic info. still holds.
    tt2

  • Sending text msgs to more than one person

    OK, I realize I'm probably just a doofus who can't figure this out, but how do you send a text message to more than one person on the iphone? I swear I've looked everywhere. Help, please? Thanks!

    You will need to use the email feature of the iPhone to do this.
    To send Apple feedback: http://apple.com/feedback

  • How to select more than one row in a JTable swing adf adf?

    how to select more than one row in a JTable swing adf adf?

    // Allow selection to span one contiguous set of rows, visible columns, or block of cells
    table.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
    // Allow multiple selections of rows, visible columns, or cell blocks
    table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);

  • How to color more than one cell in an ALV line ???

    Hi SDN community,
    I have the following problem:
    I display an internal table with the 'REUSE_ALV_GRID_DISPLAY' function and want to color two cells, not only one cell.
    Coloring one cell is no problem with...
    cell_color1 TYPE lvc_t_scol, " cell color
    DATA  gs_cellcolor    TYPE          lvc_s_scol. " to color a cell
    gs_cellcolor-fname = 'TNAME'.
    gs_cellcolor-color-col = '6'.
    gs_cellcolor-color-int = '1'.
    gs_cellcolor-color-inv = '0'.
    LOOP AT it_result.
      IF it_result-trend EQ 'fast-growing'.
        APPEND gs_cellcolor TO it_result-cell_color1.
        IF sy-subrc EQ 0.
          MODIFY it_result.
        ENDIF.
      ENDIF.
    ENDLOOP.
    and
    ls_layout-coltab_fieldname = 'CELL_COLOR1'.
    , the last one is in the layout building form.
    My problem is that in
    ls_layout-coltab_fieldname = 'CELL_COLOR1'.
    , I can only type in ONE fieldname, but I would like to color more than one field/cell, you got my problem?
    Thank you very much,
    Marius

    I'm pretty sure that the color would be controlled by what records are appended to the CELL_COLOR1 table inside IT_RESULT. . So move the code inside the IF statement, and add addition logic.
    LOOP AT it_result.
      IF it_result-trend EQ 'fast-growing'.
       gs_cellcolor-fname = 'TNAME'.
       gs_cellcolor-color-col = '6'.
       gs_cellcolor-color-int = '1'.
       gs_cellcolor-color-inv = '0'.
        APPEND gs_cellcolor TO it_result-cell_color1.
        IF sy-subrc EQ 0.
          MODIFY it_result.
        ENDIF.
    else.
       gs_cellcolor-fname = 'OTHER_FIELD'.
       gs_cellcolor-color-col = '5'.
       gs_cellcolor-color-int = '1'.
       gs_cellcolor-color-inv = '0'.
        APPEND gs_cellcolor TO it_result-cell_color1.
        IF sy-subrc EQ 0.
          MODIFY it_result.
        ENDIF.
      ENDIF.
    ENDLOOP.
    Regards,
    Rich Heilman

  • I cant text chat with more than one person

    I can normally text chat just fine, but when i try to invite more than one person to chat, i get the following error message
    Couldn’t request chatroom “[screenname here] 619401”. (Your message is too long to be sent. Please shorten it.)
    (obviously where it says screenname here, thats my screen. all lowercase letters, no spaces or weird characters.
    the weird thing is if someone else invites me to a multi person text chat, it works just fine. i just cant initiate it. any suggestions???

    Here is how I initiate a text chat.
    (0) Click on one of my buddy names in my Buddy List to highlight it.
    (1) ⌘ click on the next buddy I want to add to highlight him, too.
    (2) Repeat the ⌘ clicks for all the other buddies I want in the chat.
    (3) Click the "A" at the bottom of my buddy list to initiate the multiple-party chat.
    Try that, and see if it works for you. If you can make it work for two, it should work for more.

  • HT3529 How do I send a text message to more than one phone number at the same time?

    How do I send the same text to more than one phone at the same time?

    You'll need to see if there's an app in the App Store that does what you want. Search for "Group SMS" or similar.

  • Projector that plays more than one movie

    How can I make one projector play more than one movie? If the movies are protected, can the projector still play them? How can I link them? Thanks for your help.

    Hi Norman,
    I’ll elaborate on Sean’s reply.
    As Sean mentioned you can use:
    _movie.go("markerName", "MovieName")
    To jump to the marker named ‘Markername’ in a movie called ‘MovieName’.
    I tend to still use the verbose syntax
    go to "markerName" of movie "MovieName"
    If you had:
    go to movie "MovieName"
    you’d jump to the start of the movie (frame 1)
    you could use:
    go to movie "MovieName.dir"
    but the '.dir' is not needed and if you create a protected DXR or DCR, the statement (without the movie extension) would work.
    Now, if you want to avoid writing a unique behavior for every link you’re creating, I’ve got a tutorial that describes how to do it at:
    http://www.deansdirectortutorials.com/Lingo/paramDialog.htm
    The above uses property variables and a parameter dialog box. It does require some understanding of programming (not too much though).
    If you have D11.5, in the Library Palette, in the ‘Controls’, category, there is a ‘Jump to Movie Button’ behavior. This behavior can be dragged and dropped onto a sprite and then you can type in the marker name and movie name in a parameter dialog box to set the link for the sprite. I say D11.5 because while earlier versions of Director have this behavior, there is a small error (easily fixed) that makes the marker jumping part non-functional. Anyway, my behavior in my tut site does the same thing.
    Dean
    Director Lecturer / Consultant / Director Enthusiast
    http://www.deansdirectortutorials.com/
    http://www.multimediacreative.com.au

  • Grouping on fields that have more than one value entered.  Please need help fast!!!

    Post Author: DennisC
    CA Forum: General
    I am creating a report that is to be grouped on a particular field that can have more than one entry.  My user said they did not care how I did it but to only count the record one time.  The field that is selected is a dropdown on an form that is in Alpha order.  So the entries always appear in the the field in alpha order.  This is for use as an example:  Record 1 has a value of CAT in the field,  Record 2 has a value of CAT, DOG in the field and Record 3 has a value of CAT, DOG, HORSE in the field.  I get 3 separate groupings for the 3 records.
    Group = CAT                      
          Then the detail information appears here
    Group = CAT, DOG
          Then the detail information appears here
    Group = CAT,DOG,HORSE
          Then the detail information appears here
    What is would like to see using this example is one group for CAT with all 3 records appearing under it and ignore the other two.  This way there would all be getting counted but the report would look a little more streamlined.
    Group = CAT
          record 1 detail information
          record 2 detail information
          record 3 detail information
    thanks in advanced for any help!!!!

    Post Author: shawks
    CA Forum: General
    I am trying resolve the same/similar issue in Crystal Reports 10.  For example, on a table there is a column called X with values Xsub1, Xsub2, Xsub3, etc.  The user can select a parameter that includes Xsub2 and Xsub4.  If this is selected 2 reports are generated (one for Xsub2 and Xsub4).  What we really want is one report with the combined information for Xsub2 and Xsub4.  How is (or is it) possible to do this in Crystal Reports 10?  FYI - When the report was initially created the main body of the report was placed in the Group Footer so if the Group Footer is suppressed the content of the report is suppressed, too.
    Thanks

Maybe you are looking for

  • Regular Expression in ADF

    I have a requirement to validate one UI field with the following pattern. Can some one advise me about creating the correct pattern for the following requirement. It can have maximum of 8 characters. It can have only numbers, no - or [A-Z]. If there

  • Pages icon dock keeps hopping

    I did the pages update yesterday on my iMac (10.9.1). Today, the pages icon in the dock keeps hopping. Always twice, then stops. Then after a while it hops twice again, then stops. More distracting than anything. Anything I can do to stop it?  BTW, I

  • Wrong consignor address while printing outbound delivery via VL71

    Hi SD Gurus, Consignor address is printed wronly while printing outbound delivery using VL71 for the first time and its printing correctly when printed using VL03N. User is repeating the output in delivery and the repeated output shows correct consig

  • SAP Web Dispatcher - Dynamic URL

    Hi All, We have a scenario where a URL coming to Web Dispatcher with be dynamic ,since each time the URL will hold a different phone number and a User ID as parameters in the URL and an external application would be requring to get some data from ERP

  • Photoshop(Trial) update failed

    My photoshop( trial version) keeps saying update failed. i have not yet been on the program and just downloaded it. how do i rectify this problem?@