Editable Multi-line tooltip on JTable cells

Hi friends,
I have a JTable in a JApplet.
I have a JPopupMenu which gets displayed by right clicking any cell of the Table.
My problems are:
1. How can I restrict the popupmenu to appear by clicking a few of the columns in the table?
2. By selecting the menu item "Add comment" in the popup menu, I want to get an editable area for adding a comment for that cell.
3. By selecting the menu item "Edit comment" in the popup menu, I want to get the earlier comment in an editable area
4. By selecting the menu item "Delete comment" in the popup menu, I want to delete the comment for that cell.
5. By moving the mouse over a cell, the comment related to that cell should be diaplayed as a tool tip.
The comments I like to mimic the comments in the Excel.
If somebody can provide source code, it will be very helpful.
Please help.
Thanks in advance.

tip = getValueAt(rowIndex, colIndex).toString();
tip = "<html>"+tip.replaceAll("\\.","<br>")+"</html>";

Similar Messages

  • 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

  • Multiple Lines in a Jtable Cell

    I am trying to place multiple lines in a single cell of Jtable
    The text Of the cell comes from the database.I am trying to do it using a JLabel .If anyone can help me please do so
    thanks
    kishore
    [email protected]

    It can be done but it is quite a lot of work. Basically you have to produce your own cell renderer and use that instead. A good book on swing will tell you how to do it.

  • How to display cusomized custom tooltip(jwindow)  in jtable cell position

    Hi,
    i am trying to display custom tooltip for jtable cell. i created custom tooltip(jwindow) and on mouseover of jtable cell i am trying to display the custom tooltip.
    But it is not display the position of jtable cell. How to display the exact position of jtable cell
    please help me on this.

    Did you read the posting directly below yours which was also about a custom tool tip?
    JScrollableToolTip is buggy
    The code presented there shows the tool tip in the proper location.
    For more help create a [url http://sscce.org]SSCCE, that demonstrates the incorrect behaviour.
    Don't forget to read the "Welcome to the new home" posting at the start of the forum to learn how to use the "code tags" so posted code is formatted and readable.

  • Line-wrap in a Cell

    Hi,
    I need to implement what seems to be a commonly
    required feature - a long string in my cell
    needs to wrap around and occupy multiple rows,
    instead of getting trucated with a '...'.
    I searched the archives, and the question seems
    to have been raised a couple of times, but there
    were no satisfactory answers or pieces of code
    I could find. The suggestions seemed to be:
    1) define a textarea as the cellrenderer, and
    also manually set the height of the row to account
    for multiple lines (ugh.)
    2) define a multiline tooltip for the cell which contains the entire cell contents. That way users can
    at least mouse over to the cells they are interested in
    and read the full contents without readjusting column
    widths.
    the second solution is more acceptable to me, but I
    don't know anything about tooltips - if someone has
    a piece of code for displaying (esp. multi-line) tooltips for cells in a table, could you please post
    it ?
    Also, why isn't there a better solution for what must be a commonly encountered problem ?
    thanks a lot.
    -s

    check these out -
    http://www2.gol.com/users/tame/swing/examples/JTableExamples6.html
    http://www2.gol.com/users/tame/swing/examples/JToolTipExamples1.html

  • 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

  • Append table with multi-line cells to word report

    Hi,
    I am using LabView 7.0. I need to append table to word report and I am using Append Table to Report VI. My VI works fine as long as the table cells do not have multiple lines. For multiple lines, each line is put is a seperate cell in the word report.
    Is there a way to append multi-line cells to Word Report??? If not, any suggestions on how I can copy the multi-line table to Word report???
    Please kindly help!!
    Please see the attached document for details on the problem.
    Thanks,
    Mim
    Attachments:
    Table with multiple line cells.doc ‏33 KB

    Hi Mim,
    Yes I understood the multiple-lines part. I think the doc is the report you want. Correct ?
    The doc is generated with your VI without any modifications.
    I am using XP, Office 2002 SP3 and LV7.1
    Attachments:
    Verification Report.doc ‏39 KB

  • Edit a JTable cell, click save button, value isn't stored in JTable

    I'm editing a JTable cell, just using default editor provided by JTable
    I click a save button elsewhere in my GUI
    The value typed into the cell so far isn't stored in the TableModel yet and so doesn't get saved.
    How can I make sure the value gets stored in the JTable in the above scenario when the JButton is pressed but before saving.
    Preferably I'd like the code with the JButton not to have to know about the JTable at all.
    Cheers,
    D

    I the forums 100s of times.Many thanks. If they had a decent search on this forum I might have found it as I did try.
    Come to think of it - Sun have completely fcukd up this forum.

  • Saving an array of multi-line text cells in a format that can be read in later

    I can create an array of multi-line text entries that my program can then pick cells and compile them into a list of text.
    I would like to be able to Save the array as a file, then change my program to read in the file.
    If I use the Save Spreadsheet file vi, the data is corrupted by the carriage returns within the cells and the data read in is messed up.
    Can someone recommend a way to save the array that preserves the carriage returns?

    As far as I know, this cannot be done automatically with the basic VIs from the palletes.  I would convert the [LF] into another group of characters (likely "\n") and then save the text array to a CSV file.  Don't forget to escape any good "\" string with an extra "\.  Regular expressions would work really well:
    Just make sure you parse your entire array of strings with this.
    Olivier
    Attachments:
    SaveToCSV_WithMultiLine.vi ‏9 KB

  • 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

  • Cell.text with multi line content

    Hello anybody.
    Here is my code .
    story_title = [[NSMutableArray alloc] init];
    scripture_location = [[NSMutableArray alloc] init];
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    cell.text = [story_title objectAtIndex:indexPath.row];
    cell.lineBreakMode = UILineBreakModeWordWrap;
    cell.text = [scripture_location objectAtIndex:indexPath.row];
    return cell;
    How can i make multi line in single cell . My code is diplayed last array list content. The line break is not working.
    Please help me with example
    Nalan.

    Double click on the text box and look in properties. There are many different options there including text wrap.
    (of course I'm referring to a form field and not a bunch of text that was included in the original document)

  • 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?

  • Start or stop edit jtable cell editing

    Hello,
    I got a problem with the jtable DefaultModel isCellEditable.
    If I set the IsCellEditable to false, I would not be able to enable the cell selection as and when I want it.
    What I have in mind is the add a mouselister so that if the user select a row using fast left mouse click like the procedure shown below
    private class MouseClickHandler extends MouseAdapter {
    public void mouseClicked(MouseEvent event) {
    int no_mouseclick = 0;
    no_mouseclick = event.getClickCount();
    if (no_mouseclick >= 2) {
    int cur_row = 0;
    cur_row = table.getSelectedRow();
    // table.setColumnSelectionAllowed(true);
    // table.setRowSelectionAllowed(true);
    for (int i=0;i<table.getColumnCount();i++){
    table.editCellAt(cur_row,i);
    System.out.println("mouse row--->" + cur_row);
    I could overwrite the IsCellEditable to true to enable that particular or cell contains in that row to be able to accept input and overwrite any data which in my case obtained from the Sql database a sort of like input module using tabulation . I am also thinking of using text component or combobox to display the value for user selection , but I do not know how to enable a particular cell for editing if the Jtable created is using a non-editable DefaultModel. If I set the IsCellEditable to true, every single cell would be enable for editing , and this defeat the purpose of enable user input only upon double mouseclicks.
    By the way , I am interested to know how to track the data changes in the cell within the jtable so that only those have been modified are notify from the Table model and updated into the Sql table
    Could anyone of you out there provide some hints please
    Thanks

    Hello,
    Tablemodellistener could detect the changes in the data, how about the backend database updating and transactional activity that must be associated with the data changes?
    What is on my mind is that , the moment there is changes in the data detected by the TableModellistener, whatever records associated with or brougt up by Jtable would be all deleted from the database and then follow by the new set of new records to be inserted into the database. The disadvantage of this method is that everytime the backend database connection and activity need to be executed the moment there is a change in the data in the jtable cell. For example the user may be just amendment to only one cell , but all the records associated need to be deleted and then inserted again.
    Perhaps there are better solution to deal with Jtable and JDBC backend connection where in this case, I am using JDO to undertake the database activity like the observable modelling .
    Could someone provide the hint please
    Thank

  • Combo Box Edits in acrobat Forms, how to do a multi-line combo box?

    Could only create a one-liners for this editable combo box, is there a way to create a multi-line like the other fields?

    Nope. But you can set up a multiline text field that gets populated with the complete text you want when an item is selected from a combo box.The combo box items might be abbreviated or coded versions of the complete text you want to display.

  • Displaying a multi-line text block in an ALV grid cell

    Can I display a multi-line text block (i.e. a paragraph of text) in an ALV grid cell?
    If yes, what properties do I set in the Field Catalaog (I tried the style and that didnt seem to work)
    Thanks

    By default ALV Grid merges fields with same values vertically.
    Isn't that only when the column is part of the sort key? You also have to consider the user changing the sort sequence, which can make the text jumbled up. In one of my reports I have made the cell a hotspot and displayed the text in a popup. Of course you cannot print it.
    Cheers,
    Ramki.

Maybe you are looking for

  • Not able to access human task form (11.1.1.4)

    I installed SOA Suite with BPM Suite 11.1.1.4. I ran into quite a few issues. The biggest one is I am not able to access the human task form in BPM workspace even for the new application created in 11.1.14. Do you have such issue? I am not sure if it

  • Error building the BPM application

    Hello, My BPM application was running fine. When I add one more Webdynpro component as dependent project and use Its UI on certain step. Since then my BPM application has an error in building the project which is "Build fail for <project name> in var

  • Dataguard and ASM on 10gR2

    I can find no information on if dataguard can be used with ASM. Does it require the use of datafiles? I am upgrading databases from 9.2.0.4 to 10g and will have a standby and remote location standby also for distaster recovery. Any information and bo

  • Info about logging.xml in JDeveloper weblogic domains? JDK Logging Control

    Is there any documentation on the file <DomainDir>/config/fmwconfig/servers/<ServerName>/logging.xml? It seems to control JDK 1.4 logging for my weblogic server and overrides settings from the logging.properties file. This is important new behaviour!

  • FTP Client via iWeb

    Can I use my iWeb site for a FTP Client? I just downloaded Classic FTP for Mac and it's requesting that I designate a 'site'. I'm inexperienced in this area so not sure what I'm supposed to do. Any guidance would be extremely appreciated. Barry