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.

Similar Messages

  • Multiple selection in a JTable cell

    Dear friends,
    I have to provide a way to user select multiple names in a unique cell of a JTable....
    i.e., the user click on te cell, and some pane or list appears on the screen.. te user then select some field and then close the pane.
    next time te user click on the same cell, the list comes with the updated fields...
    how to ?
    JList? JComboBox ? JOptionPane ?

    If you use a JButton as the cell editor, you could invoke a JList from button's event listener.

  • How can I have multiple lines in a table cell???

    hi
    how can I separate lines in a table cell in LV5.1.1??
    EndOfLine doesn't work, neither does CR or LF..
    has anybody an idea???
    thanks

    thanks.. but there is nothing like "multi line input" in my LV (5.1.1).. I think it might be impossible to
    do it in 5.1.1, it's really time to upgrade ;-)
    cheers

  • Multiple JButtons in a JTable cell: handling events

    Hello!
    I'm trying to develop a Swing application which makes use of tables in several panels.
    Each row of each table should present the user two buttons, one for editing the row, one for viewing details of that row. Both editing and viewing are done in another panel.
    I thought I could add the buttons as the last column of each row, so I made a panel which holds the two buttons and the id of the row, so that I know what I have to edit or view.
    I managed to insert the panel as the last column, but I can't have the buttons click.
    I studied cell renderers and editors from several tutorials and examples, but evidently I can't understand either of them: whatever I try doesn't change the outcome... :(
    Below is the code I use, except for imports and packages:
    ActionPanel.java - The panel which holds the buttons and the row id
    public class ActionPanel extends JPanel{
      private static final long serialVersionUID = 1L;
      public static String ACTION_VIEW="view";
      public static String ACTION_EDIT="edit";
      private String id;
      private JButton editButton;
      private JButton viewButton;
      public String getId() {
        return id;
      public void setId(String id) {
        this.id = id;
      public JButton getEditButton() {
        return editButton;
      public void setEditButton(JButton editButton) {
        this.editButton = editButton;
      public JButton getViewButton() {
        return viewButton;
      public void setViewButton(JButton viewButton) {
        this.viewButton = viewButton;
      public ActionPanel() {
        super();
        init();
      public ActionPanel(String id) {
        super();
        this.id = id;
        init();
      private void init(){
        setLayout(new FlowLayout(FlowLayout.CENTER, 10, 0))
        editButton=new JButton(new ImageIcon("./images/icons/editButtonIcon.png"));
        editButton.setBorderPainted(false);
        editButton.setOpaque(false);
        editButton.setAlignmentX(TOP_ALIGNMENT);
        editButton.setMargin(new Insets(0,0,0,0));
        editButton.setSize(new Dimension(16,16));
        editButton.setMaximumSize(new Dimension(16, 16));
        editButton.setActionCommand(ACTION_EDIT);
        editButton.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent e) {
            JOptionPane.showMessageDialog(null, id, "Editing", JOptionPane.INFORMATION_MESSAGE);
        viewButton=new JButton(new ImageIcon("./images/icons/viewButtonIcon.png"));
        viewButton.setMaximumSize(new Dimension(16, 16));
        viewButton.setActionCommand(ACTION_VIEW);
        viewButton.setBorderPainted(false);
        viewButton.setOpaque(false);
        viewButton.setMargin(new Insets(0,0,0,0));
        viewButton.setSize(new Dimension(16,16));
        viewButton.setMaximumSize(new Dimension(16, 16));
        viewButton.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent e) {
            JOptionPane.showMessageDialog(null, id, "Viewing", JOptionPane.INFORMATION_MESSAGE);
        add(viewButton);
        add(editButton);
    ActionPanelRenerer.java - the renderer for the above panel
    public class ActionPanelRenderer implements TableCellRenderer{
      public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
        Component ret=(Component)value;
        if (isSelected) {
          ret.setForeground(table.getSelectionForeground());
          ret.setBackground(table.getSelectionBackground());
        } else {
          ret.setForeground(table.getForeground());
          ret.setBackground(UIManager.getColor("Button.background"));
        return ret;
    ActionPanelEditor.java - this is the editor, I can't figure out how to implement it!!!!
    public class ActionPanelEditor extends AbstractCellEditor implements TableCellEditor{
      public Component getTableCellEditorComponent(JTable table,Object value,boolean isSelected,int row,int column) {
        return (ActionPanel)value;
      public Object getCellEditorValue() {
        return null;
    ServicesModel.java - The way I fill the table is through a model:
    public class ServicesModel extends AbstractTableModel  {
      private Object[][] data;
      private String[] headers;
      public ServicesModel(Object[][] services, String[] headers) {
        this.data=services;
        this.headers=headers;
      public int getColumnCount() {
        return headers.length;
      public int getRowCount() {
        return data.length;
      public Object getValueAt(int row, int col) {
        if(col==data.length-1)
          return new ActionPanel(""+col);
        else
          return data[row][col];
      public boolean isCellEditable(int row, int col) {
        return false;
      public Class getColumnClass(int column) {
        return getValueAt(0, column).getClass();
    ServicesList.java - The panel which holds the table (BasePanel is a custom class, not related to the table)
    public class ServicesList extends BasePanel {
      private JLabel label;
      private JTable grid;
      public ServicesList(SessionManager sessionManager){
        super(sessionManager);
        grid=new JTable() ;
        add(new JScrollPane(grid), BorderLayout.CENTER);
        layoutComponents();
      public void layoutComponents(){
        ConfigAccessor dao=new ConfigAccessor(connectionUrl, connectionUser, connectionPass);
        String[] headers=I18N.get(dao.getServiceLabels());
        grid.setModel(new ServicesModel(dao.getServices(), headers));
        grid.setRowHeight(20);
        grid.getColumnModel().getColumn(headers.length-1).setCellRenderer(new ActionPanelRenderer());
        grid.setDefaultEditor(ActionPanel.class, new ActionPanelEditor());
        grid.removeColumn(grid.getColumnModel().getColumn(0));
        dao.close();
    }Please can anyone at least address me to what I'm doing wrong? Code would be better, but examples or hints will do... ;)
    Thank you very much in advance!!!

    Hello!
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class MultipleButtonsInCellTest {
      public JComponent makeUI() {
        String[] columnNames = {"String", "Button"};
        Object[][] data = {{"AAA", null}, {"BBB", null}};
        DefaultTableModel model = new DefaultTableModel(data, columnNames) {
          @Override public Class<?> getColumnClass(int column) {
            return getValueAt(0, column).getClass();
        JTable table = new JTable(model);
        table.setRowHeight(36);
        ActionPanelEditorRenderer er = new ActionPanelEditorRenderer();
        TableColumn column = table.getColumnModel().getColumn(1);
        column.setCellRenderer(er);
        column.setCellEditor(er);
        JPanel p = new JPanel(new BorderLayout());
        p.add(new JScrollPane(table));
        p.setPreferredSize(new Dimension(320, 200));
        return p;
      public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
          @Override public void run() { createAndShowGUI(); }
      public static void createAndShowGUI() {
        JFrame f = new JFrame();
        f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        f.getContentPane().add(new MultipleButtonsInCellTest().makeUI());
        f.pack();
        f.setLocationRelativeTo(null);
        f.setVisible(true);
    class ActionPanelEditorRenderer extends AbstractCellEditor
                       implements TableCellRenderer, TableCellEditor {
      JPanel panel1 = new JPanel();
      JPanel panel2 = new JPanel();
      public ActionPanelEditorRenderer() {
        super();
        JButton viewButton2 = new JButton(new AbstractAction("view2") {;
          public void actionPerformed(ActionEvent e) {
            JOptionPane.showMessageDialog(null, "Viewing");
        JButton editButton2 = new JButton(new AbstractAction("edit2") {;
          public void actionPerformed(ActionEvent e) {
            JOptionPane.showMessageDialog(null, "Editing");
        panel1.setOpaque(true);
        panel1.add(new JButton("view1"));
        panel1.add(new JButton("edit1"));
        panel2.setOpaque(true);
        panel2.add(viewButton2);
        panel2.add(editButton2);
      @Override
      public Component getTableCellRendererComponent(JTable table, Object value,
                   boolean isSelected, boolean hasFocus, int row, int column) {
        panel1.setBackground(isSelected?table.getSelectionBackground()
                                       :table.getBackground());
        return panel1;
      @Override
      public Component getTableCellEditorComponent(JTable table, Object value,
                                    boolean isSelected, int row, int column) {
        panel2.setBackground(table.getSelectionBackground());
        return panel2;
      @Override
      public Object getCellEditorValue() {
        return null;
    }

  • 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>";

  • Copy and Paste Multiple lines into a single cell

    Folks:
    I need to copy some plain text data into a single cell that has been merged with other cells to provider a larger unit; however, every time I copy and paste my data it gives me an error. In addition, if I paste the data into a single cell, the next line
    of data inserts into the next row.
    I understand that Alt+enter is a quick way to do what I want, but I already have the data typed out, and I do not want to type the data again.
    Example: (If possible I want in one single cell)
    Disks=32
    Total space=1.74TB
    Used space=1.20TB
    Free space=0.54TB
    Thank you!!!

    Is there any way to do this but keep the source formatting? I don't see any "Paste Special" options when you do it this way.
    That is not possible - when you copy/paste this way, you only copy the plain text, not the formatting. You'll have to apply formatting to the cell with pasted lines from scratch.
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • Multiple JRadioButtons in a JTable cell

    I have this code that works, but I want to make it so only a single click is require to change the radio buttons in the cell. Right now it takes a double click.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.table.*;
    import javax.swing.event.*;
    * @version 1.2 08/13/99
    public class JRadioButtonTableExample2 extends JFrame {
      public JRadioButtonTableExample2(){
        super( "JRadioButtonTable Example" );
            String[] columnHeader = {"Questions","Answer"};
             Object[][] o = new Object[50][2];
             DefaultTableModel dm = new DefaultTableModel();
             dm.setDataVector(o,columnHeader);
        JTable table = new JTable(dm);
        String[] answer = {"A","B","C"};
        table.getColumn("Answer").setCellRenderer(
          new RadioButtonRenderer(answer)
        table.getColumn("Answer").setCellEditor(
          new RadioButtonEditor(new JCheckBox(),
                                new RadioButtonPanel(answer))
        JScrollPane scroll = new JScrollPane(table);
        getContentPane().add( scroll );
      // Cell base
      class RadioButtonPanel extends JPanel {
        JRadioButton[] buttons;
        RadioButtonPanel(String[] str) {
          setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
          buttons = new JRadioButton[str.length];
          for (int i=0; i<buttons.length; i++) {
            buttons[i] = new JRadioButton(str);
    buttons[i].setFocusPainted(false);
    add(buttons[i]);
    public void setSelectedIndex(int index) {
    for (int i=0;i<buttons.length;i++) {
    buttons[i].setSelected(i == index);
    public int getSelectedIndex() {
    for (int i=0; i<buttons.length; i++) {
    if (buttons[i].isSelected()) {
    return i;
    return -1;
    public JRadioButton[] getButtons() {
    return buttons;
    class RadioButtonRenderer extends RadioButtonPanel
    implements TableCellRenderer {   
    RadioButtonRenderer(String[] strs) {
    super(strs);
    public Component getTableCellRendererComponent(JTable table, Object value,
    boolean isSelected, boolean hasFocus, int row, int column) {
    if (value instanceof Integer) {
    setSelectedIndex(((Integer)value).intValue());
    return this;
    class RadioButtonEditor extends DefaultCellEditor
    implements ItemListener {
    RadioButtonPanel panel;
    public RadioButtonEditor(JCheckBox checkBox,RadioButtonPanel panel) {
    super(checkBox);
    this.panel = panel;
    ButtonGroup buttonGroup = new ButtonGroup();
    JRadioButton[] buttons = panel.getButtons();
    for (int i=0; i<buttons.length; i++) {
    buttonGroup.add(buttons[i]);
    buttons[i].addItemListener(this);
    public Component getTableCellEditorComponent(JTable table, Object value,
    boolean isSelected, int row, int column) {
    if (value instanceof Integer) {
    panel.setSelectedIndex(((Integer)value).intValue());
    return panel;
    public Object getCellEditorValue() {
    return new Integer(panel.getSelectedIndex());
    public void itemStateChanged(ItemEvent e) {
    super.fireEditingStopped();
    public static void main(String[] args) {
    JRadioButtonTableExample2 frame = new JRadioButtonTableExample2();
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    frame.setSize( 230, 140 );
    frame.setVisible(true);

    It looks to me like the problem is that the renderer is interfering with the editor. When the editor is invoked, something in jtable is rerendering the other items. This is causing a flood of change events to be fired. I'm not sure how you would fix this. The first thing that occurred to me was to make a separate set of buttons for the renderer vs the editor. I don't have time to try it right now.

  • How do i add multiple lines in a cell (like a list) in Excel for MAC?

    I'm trying to add multiple lines (in the form of a list) in a individual cell in Excel for MAC.  I used ALT Enter on my PC but that doesn't work on the iMac.  Does anyone know how to do this?
    Thanks!

    It's been a while but I think you hold SHIFT while typing a page break (RETURN) to make a new line without shifting to another cell.
    However, as Excel isn't an Apple product, I am sure you will get a faster and more current answer by using Microsoft's Office:Mac forums here:
    Office for Mac forums
    They are very good.

  • Multiple Lines in a Single ALV Grid Cell

    Is there any way to Display Multiple Lines in a Single ALV Grid Cell.
    This can be accomplished by Sorting the First 3 fields and Make it Looks like below displayed format.
    But My problem is while downloading also it should be Displayed in the same format.
    All inputs are highly appreciated.

    there was a post similar to this some days back... search it..
    any ways...
    what u can do is...
    arrange ur final internal table so that it will look like same line...
    like...lets say ur internal table is :
    A1 B1 C1 D1 123
    A1 B1 C2 D2 123
    A1 B2 C1 D1 123
    A1 B2 C2 D2 123
    and u can rearrange ur table to be like
    A1 B1 C1 D1 123
          C2 D2 123
    A1 B2 C1 D1 123
          C2 D2 123
    what i mean to say is dont pass the fields if they are same in the previous line... try it out..
    and then pass it two ur ALV.
    it will look like they are in one line
    Edited by: soumya prakash mishra on Jun 17, 2009 1:31 PM

  • How do I add multiple lines to a cell

    I am trying to create an assignment sheet in Numbers. I am using the "Schedule" template. Under each day of the week, I want to add daily assignments. But each assignment may need multiple lines. In the screenshot below, I want to add another line under "Genesis 5" but still have it within the same cell. How can I do that?

    I do extensive research  build on the work of others

  • Multiple lines in a cell in excel download

    Hi,
    I have used insert_full of i_oi_spreadsheet interface for downloading internal table.. i have a text field which i need to display in multiple lines in one cell.
    Is that possible? Please help,
    Regards,
    Rohit.

    Rohit,
    Clipboard this code into your editor and see if it helps you out.  Please reward points.
    *& Report  ZR_SANDBOX_PROG
    REPORT Zsandbox_prog .
    INCLUDE OLE2INCL.
    DATA: hExcel TYPE OLE2_OBJECT,      " Excel object
          hWorkBooks TYPE OLE2_OBJECT,  " list of workbooks
          hWorkbook TYPE OLE2_OBJECT,   " workbook
          hSheet TYPE OLE2_OBJECT,      " worksheet object
          hRange TYPE OLE2_OBJECT,      " range object
          hRange2 TYPE OLE2_OBJECT,      " range object
          hBorders TYPE OLE2_OBJECT,    " Border object
          hInterior TYPE OLE2_OBJECT,   " interior object - for coloring
          hColumn TYPE OLE2_OBJECT,     "column
          hCell TYPE OLE2_OBJECT,       " cell
          hFont TYPE OLE2_OBJECT,       " font
          hSelected TYPE OLE2_OBJECT,   " range object
          hPicture TYPE OLE2_OBJECT,    "picture object
          hLogo TYPE OLE2_OBJECT.       "Logo object
    types:  begin of t_Excel,
              Period_Literal(20),
              Pd_Wk_Literal(20),
              Coop_Literal(40),
              Sugg_Price(20),
              Cost(20),
              Margin(20),
              Comments(100),
            end of t_Excel.
    data: r_Excel type t_Excel.
    data: i_Excel type table of t_Excel with header line.
    field-symbols: <Val> type any.
    data: col_Cnt type i.
    data: row_Cnt type i.
    data: l_range(30).
      parameters: wraptext as checkbox.
      CREATE OBJECT hExcel 'EXCEL.APPLICATION'.
      PERFORM ERR_HDL.
    get list of workbooks, initially empty
      CALL METHOD OF hExcel 'Workbooks' = hWorkbooks.
      PERFORM ERR_HDL.
    add a new workbook
      CALL METHOD OF hWorkbooks 'Add' = hWorkbook.
      PERFORM ERR_HDL.
    Get Worksheet object.
      get property of hWorkbook 'ActiveSheet' = hSheet.
      SET PROPERTY OF hExcel  'Visible' = 1.
      row_cnt = 1.  col_cnt = 1.
      do 5 times.
        Perform Load_Dummy_Values.
      enddo.
    *Pass the internal table values to the spreadsheet.
      loop at i_Excel into r_Excel.
        do 7 times.
          assign component sy-index of STRUCTURE r_excel TO <Val>.
          PERFORM Fill_The_Cell USING row_cnt col_cnt 0 <Val>.
          col_cnt = col_cnt + 1.      "increment column
        enddo.
        row_cnt =   row_cnt + 1.    "increment row
        col_cnt = 1.                  "reset column to A (ie. col 1)
      endloop.
      if not WrapText is initial.
        move 'G:G' to l_range.
        CALL METHOD OF hExcel 'RANGE' = hRange EXPORTING #1 = l_range.
        set property of hRange 'WrapText' = 1.
      endif.
    Release excel.
      FREE OBJECT hExcel.
      PERFORM ERR_HDL.
    FORM Fill_The_Cell USING I J BOLD TheValue.
      CALL METHOD OF hExcel 'Cells' = hCell EXPORTING #1 = I #2 = J.
      PERFORM ERR_HDL.
      SET PROPERTY OF hCell 'Value' = TheValue.
      PERFORM ERR_HDL.
      GET PROPERTY OF hCell 'Font' = hFont.
      PERFORM ERR_HDL.
      SET PROPERTY OF hFont 'Bold' = BOLD.
      PERFORM ERR_HDL.
    ENDFORM.
    *&      Form  ERR_HDL
          outputs OLE error if any
    -->  p1        text
    <--  p2        text
    FORM ERR_HDL.
      IF SY-SUBRC <> 0.
        message i000(zz) with 'OLE Automation error: ' SY-SUBRC.
        exit.
      ENDIF.
    ENDFORM.                    " ERR_HDL
    Form Load_Dummy_Values.
      r_excel-Period_Literal = 'Period 1'.
      r_excel-Pd_Wk_Literal = 'P1 / Wk1'.
      r_excel-Coop_Literal = 'Promo Event'.
      r_excel-Sugg_Price = '$ 1.25'.
      r_excel-Cost  = '$ 0.50'.
      r_excel-Comments =
       'This is a really long field with one hundred bytes to it.'.
      append r_excel to i_Excel.
    EndForm.

  • Table Cell Editor which allows to input multiple lines of text...

    Hi there
    Does anyone know how to write a table cell editor which allows users to input multiple lines of text? please provide some sample if possible...
    Thanks
    Ken

    I'm assuming you also want the renderer to display multiple lines? if so, make a class that extends JTextArea and that implements the TableCellEditor and TableCellRenderer interfaces, then set instances of this as the editor and renderer for the TableColumn in question. The implementation of most of the methods in these interfaces is trivial, often just this.setBackground() based on the table.getSelectionBackground() or table.getBackground(), a this.setText() based on the value passed in, then just a 'return this'.
    You might want to make an abstract class which implements these interfaces for you, and which delegates to a simple abstract method that you override to return the renderer/editor component.
    Note that you must use two instances of the class you make, one for the renderer and one for the editor, since it must be able to be able to render the remainder of the table's cells without interfering with the JTextArea performing the editing. (alternatively you could make two classes that extend JTextArea, each just implementing one of the interfaces, but this is more effort I think.) Also note that you must increase the table's row height to get more than one row visible.

  • Jtable: can a row have multiple lines

    Hello all,
    Can a Jtable row have multiple lines? For instance, if the string is too long, can i set a property so that the line breaks and makes the row larger (vertically), rather than carrying off the table (horizontally)? If so, can you please point me in the direction of what property to edit.
    Thanks in advance!

    You should be able to write a renderer using a JTextArea and set it on that column. that should atleast give you a start to wrap the text. But you need to add it to the scroll pane etc etc.
    but i think you need to do more to increase the size of the row vertically.
    Hope this gives you a start
    -nicedude

  • Multiple JButtons inside JTable cell - Dispatch mouse clicks

    Hi.
    I know this subject has already some discussions on the forum, but I can't seem to find anything that solves my problem.
    In my application, every JTable cell is a JPanel, that using a GridLayout, places vertically several JPanel's witch using an Overlay layout contains a JLabel and a JButton.
    As you can see, its a fairly complex cell...
    Unfortunately, because I use several JButtons in several locations inside a JTable cell, sometimes I can't get the mouse clicks to make through.
    This is my Table custom renderer:
    public class TimeTableRenderer implements TableCellRenderer {
         Border unselectedBorder = null;
         Border selectedBorder = null;
         public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
                   boolean hasFocus, int row, int column) {
              if (value instanceof BlocoGrid) {
                   if (isSelected) {
                        if (selectedBorder == null)
                             selectedBorder = BorderFactory.createMatteBorder(2,2,2,2, table.getSelectionBackground());
                        ((BlocoGrid) value).setBorder(selectedBorder);
                   } else {
                        if (unselectedBorder == null)
                             unselectedBorder = BorderFactory.createMatteBorder(2,2,2,2, table.getBackground());
                        ((BlocoGrid) value).setBorder(unselectedBorder);
              return (Component) value;
    }and this is my custom editor (so clicks can get passed on):
    public class TimeTableEditor extends AbstractCellEditor implements TableCellEditor {
         private TimeTableRenderer render = null;
         public TimeTableEditor() {
              render = new TimeTableRenderer();
        public Component getTableCellEditorComponent(JTable table, Object value,
                boolean isSelected, int row, int column) {
             if (value instanceof BlocoGrid) {
                  if (((BlocoGrid) value).barras.size() > 0) {
                       return render.getTableCellRendererComponent(table, value, isSelected, true, row, column);
             return null;
        public Object getCellEditorValue() {
            return null;
    }As you can see, both the renderer and editor return the same component that cames from the JTable model (all table values (components) only get instantiated once, so the same component is passed on to the renderer and editor).
    Is this the most correct way to get clicks to the cell component?
    Please check the screenshot below to see how the JButtons get placed inside the cell:
    http://img141.imageshack.us/my.php?image=calendarxo9.jpg
    If you need more info, please say so.
    Thanks.

    My mistake... It worked fine. The cell span code was malfunctioning. Thanks anyway.

  • Rendering multiple objects in JTable cells

    Hi,
    I wish to render in a single JTable cell (actually all cells in a Column) an ImageIcon and it's associated description string. The description string should be rendered below the ImageIcon, as it's caption. How can this be done? I assume a custom cell renderer, but the details are muddy at this point.
    thanks!
    JPL

    Thanks.
    I have looked atthe tutorial, but it focuses on a single object type per cell - I've got two different types (an ImageIcon and a String) that will occupuy a single cell.
    Taking a conceptual leap here, is it possible to create a new TableCellRenderer that houses a JPanel and GridLayout, and then place an ImageIcon and JLabel into that panel? I guess as long as things are JComponents, should I be OK with this approach?
    thanks,
    jpl

Maybe you are looking for

  • Error message when trying to sync: "Please try again."

    I had to format my HDD and reinstall everything. Previously I had set up Firefox Sync so I could retrieve all my bookmarks and whatnot. When I put in the 3 part code to retrieve said data, it gives me an error saying "Please try again." No error code

  • WebHelp not displaying content in left nav pane

    Any suggestions for why WebHelp is not displaying contents in the left navigation pane? When Help is called, it displays the frame (including buttons such as glossary, search, contents, etc) and the work area, but does not show the TOC in the left na

  • Search BAPI for BONDS

    Hi All, i have to migrate Bonds & Guarantees, i search now a BAPI for the Bonds, but imk not sure if i have the right one (BUS5200??), i have to migrate the advance payment Bonds, Performance Bonds and other Bonds, this are the Product types. I have

  • What's this new icon on the status bar?

    Noticed this little icon for the first time after the Jelly Bean update. It's kind of sandwiched between the LTE icon and the signal strength bars. Anyone know what this is?

  • Graph Legend text size

    Hello, i cant find an attribute to set the text size of the graph legend. There are som Plot Attributes to set the font and font length but no Attribute for the size? How can i set the size of the grapg legend? Thanks Norbert Rieper