Inserting Pics in a JTable

I'd like to include an ID of the person within my table.
Using DefaultTableModel and ImageIcon, how can I insert a picture?
Is it even possible to enter a non-textual entry into a JTable?
Here's what I did:
JMenuItem insertPicture;
JTable contactTable;
DefaultTableModel details;
else if(ae.getSource() == insertPicture)
  // Column and row details
  int row = contactTable.getSelectedRow();
  int column = contactTable.getSelectedColumn();
  // Using a string to store the picture's location details
  String fileName;
  FileDialog location = new FileDialog(ContactDetails.this,   
            "Choose picture", FileDialog.LOAD);
  // Displaying the FileDialog
  location.show();
  // Getting the image and inserting it in the JTable
  ImageIcon image = new ImageIcon(location.getDirectory()+
  location.getFile());
  details.setValueAt(image, row, column);
}My problem is that within the row (to which the picture should be placed), I'm getting only the String description of the image's location. How can I correct this?
Much thanks in advance!
Reformer!

import java.awt.*;
import java.net.*;
import javax.swing.*;
import javax.swing.table.*;
public class Test {
    public static void main(String[] args) throws MalformedURLException {
        DefaultTableModel model = new DefaultTableModel(new String[]{"path","image"}, 0) {
            public Class getColumnClass(int columnIndex) {
                return columnIndex==1? Icon.class : String.class;
            public boolean isCellEditable(int rowIndex, int columnIndex){
                return false;
        URL[] urls = {
            new URL("http://today.java.net/jag/bio/JagHeadshot-small.jpg"),
            new URL("http://today.java.net/jag/bio/JAG2001small.jpg"),
            new URL("http://blogs.sun.com/roller/resources/jag/2005_09_14_03-44-21-438_n1.small.png")
        for(int i=0; i<urls.length; ++i)
            model.addRow(new Object[]{urls.toString(), new ImageIcon(urls[i])});
JTable table = new JTable(model);
table.setRowHeight(240);
JScrollPane sp = new JScrollPane(table);
sp.setPreferredSize(new Dimension(600,450));
final JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(sp);
f.pack();
SwingUtilities.invokeLater(new Runnable(){
public void run() {
f.setLocationRelativeTo(null);
f.setVisible(true);

Similar Messages

  • Exception -arrayindexoutobound  while inserting checkbox in a jtable

    hello,
    i am using oracle as backend. As you might be knowing that oracle doesn't store boolean datatype.
    so now please tell me how to insert checkbox in a jtable.
    please do help me if you can.

    HELLO camickr
    ONE INTERESTING THING IS HAPPENING->
    i had created 2 table in my form 1) jtable1 2) jtable2
    i had declared the listener on JTABLE1 as->
    jTable1.addMouseListener(new Mousehandler())
    I HAD WRITTEN THE METHOD AS->
    public class Mousehandler extends MouseAdapter
    public void mouseClicked(MouseEvent me)
    //NOTE ->HERE IS THE CODE TO ADD CHECKBOX ON A COLUMN FOR JTABLE1
    TableColumn sport= jTable1.getColumnModel().getColumn(1);
    // str=jTable1.getCellEditor();
    JCheckBox jCheckBox1 = new JCheckBox();
    sport.setCellEditor(new DefaultCellEditor(jCheckBox1));
    //NOTE-> HERE IS THE CODE TO ADD JCHECKBOX ON A JTABLE2
    TableColumn sportcol = jTable2.getColumnModel().getColumn(1);
    JCheckBox jCheckBox2 = new JCheckBox();
    sportcol.setCellEditor(new DefaultCellEditor(jCheckBox2));
    now when i click on JTABLE1 IT IS THROWING EXCEPTION BUT WHEN FUNCTIONING WITH jTable2 WHEN I CLICK ON THE COLUMN IN WHICH I HAD INSERTED CHECKBOX IT IS FUNCTIONING PROPERLY WITHOUT ANY ERROR.
    NOTE-> I HAD TO CLICK ONCE ON JTABLE1 THEN ONLY JTABLE2
    FUNCTION BECAUSE I HAD DECLARED LISTENER FOR JTABLE1 ONLY.(JTABLE1 IS THROWING AN EXCEPTION ARRAYINDEXOUTOFBOUND when i click on the column in which i had inserted jcheckbox im my jtable1)
    PLEASE DO HELP ME IF YOU CAN.
    THANK YOU.

  • Inserting Custom object in JTable

    Hi All
    I am new to JAVA.
    I am trying to insert custom data to JTable.
    Example:
    I have a class called Student with some instance fields(like Name,age,sex ), and I want to add object of Student type to JTable.
    In table I want to display Student class fields. I have extended a class StudentModel from AbstractTableModel.My StudentModel
    contains a Vector to keep student data.
    But how do I add student object to StudentModel.and display in JTable
    please help
    thanks in advance

    Hello,
    apparently your problem is not related to Swing but to learning the Java language.
    If your aim is to learn Java, you should tackle this compile error. For that I suggest you turn to a colleague or a fellow student... or continue here, but you need to give more code than just the bit that doesn't compile.
    If your aim is to make the darn program display students in a JTable, you can have a look at BeanTableModel (http://tips4java.wordpress.com/2008/11/27/bean-table-model/).
    Best regards,
    J.

  • Can't insert pic or table into CEWP on site page.

    I have a wiki where I have no problem inserting tables, pics, hyperlinks, and even editing the HTML to do all kinds of fun stuff.
    Today I try to insert an image into a CEWP on a site page and every time I paste in the URL and click OK nothing shows up.  Same thing happens with table.
    The best I have been able to with the CEWP on a regular site page is with HTML...I get a little black box with white x where the pic should be, but I do get the mouse over and I can get it to hyperlink when I click on it.
    What is going on here?  I can insert pics and tables into a list or announcements section if the column is using a rich text editor, but not on a regular site page.  I can only use the image web part which sucks because I cant make it hyperlink.
    Is it my version of Internet Explorer?  Did I make some change that broke SharePoint 2007?  Did someone else make a change to the site that screwed this up?  WAS I NEVER ABLE to do this and am just now realizing that CEWP have this limitation?
    -Bill

    Hi Bill,
    I believe for your case, creating picture library will solve your issue. Please refer the below reference URL which explains about recommended practice to use CEWP.
    http://www.nothingbutsharepoint.com/2009/10/30/adding-pictures-with-hyperlinks-in-sharepoint-aspx/
    if you need more information please let us know
    Sekar - Our life is short, so help others in their growth Whenever you see a reply and if you think is helpful, click
    Vote As Helpful And whenever you see a reply being an answer to the question of the thread, click
    Mark As Answer
    Why put the insert table or insert image into the CEWP editor if they can't be used?  Why not at least do the courtesy of grey them out so I do not spend two days thinking I am crazy or need to rebuild my entire SP sites etc...?
    Thank you for your response.
    Bill
    -Bill

  • Insert an image in JTable

    hi all
    how can i insert an image in JTable instead of text in a row?
    angela

    Hi
    I am sending u two bits of codes
    execute these and let me know
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.table.*;
    import javax.swing.border.*;
    public class FrozenTable extends JScrollPane {
    public FrozenTable()
    TableModel tableModel = new AbstractTableModel()
    public String getColumnName(int col) { return "Column " + col; }
    public int getColumnCount() { return 20; }
    public int getRowCount() { return 40;}
    public Object getValueAt(int row,int col) { return new Integer(row * col); }
    JTable table1 = new JTable(tableModel);
    JTable table2 = new JTable(tableModel);
    TableColumnModel columnModel = table1.getColumnModel();
    TableColumnModel columnModel2 = new DefaultTableColumnModel();
    TableColumn col1 = columnModel.getColumn(0);
    TableColumn col2 = columnModel.getColumn(1);
    columnModel.removeColumn(col1);
    columnModel.removeColumn(col2);
    columnModel2.addColumn(col1);
    columnModel2.addColumn(col2);
    for(int i = 0; i < 2; i++)
    TableColumn col = columnModel2.getColumn(i);
    col.setWidth(80);
    col.setMinWidth(80);
    table2.setColumnModel(columnModel2);
    table2.setPreferredScrollableViewportSize(table2.getPreferredSize());
    table1.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    table1.getTableHeader().setUpdateTableInRealTime(false);
    table2.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    table2.getTableHeader().setUpdateTableInRealTime(false);
    table2.getColumnModel().getColumn(0).setCellRenderer( new ColorRenderer(0) );
    table2.setBorder(new CompoundBorder(new MatteBorder(0,0,0,1,Color.black), table2.getBorder()));
    setViewportView(table1);
    setRowHeaderView(table2);
    setCorner(JScrollPane.UPPER_LEFT_CORNER, table2.getTableHeader());
    public static void main(String[] args)
    JFrame frame = new JFrame();
    JPanel panel = new JPanel();
    FrozenTable table = new FrozenTable();
    panel.setLayout(new GridLayout(1,1));
    panel.add(table);
    frame.getContentPane().add(panel);
    frame.setSize(500,250);
    frame.setVisible(true);
    class yourClass extends JLabel implements TableCellRenderer
         int selectedRow = 0;
         public yourClass ()
              super();
              setOpaque(true);
         public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
              try
                   setIcon(new ImageIcon("image.gif") );          
              }catch(Exception e) {  }
              return this;
    Cheers :)
    Nagaraj

  • Problem while inserting new Column in JTable

    Hi,
    I am facing Problem while inserting new Column in JTable.
    I have a JTable with one inherited ColumnModel class.
    When I am adding the column and moving towards the corresponding location, it moves successfully.
    but if I am adding another column or making any changes to table column structure the table retains the defualtcolumn structure.
    please help me to solve this..
    Regards
    Ranjith.........

    Maybe this example will help:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=579527

  • How to insert new row in JTable?

    In my application,I have a jTable. And the form dose not have a Nevigation bar.
    After I retrieve a record into the jTable, I want to add a new row after the retrieved record. But I could not create a new row by pressing the down key at the last row of the jTable(I could do that in Oracle Form). Dose jTabel have such feature as that in Oracle Form? Or I can do that in another way?

    Such a feature is not available, but you could add a key event handler which works its magic when it detects a press on the down arrow key, while the last row is selected. Then you can perform the code to insert a new row.

  • Inserting Pics into iWeb

    I have been assembling some portions of our bogl but am concerned about file sizes. We have a Nikon d70 and which has pretty large files when in fine mode. I pull them into iWeb from iPhoto with no postprocessing for size/res. It puts relatively small thumbnails but the slideshow files are pretty big (110-120kb).
    Do most people post process before inserting? I thought iWeb pretty much did all that for you to a set standard or does it base it on a percentage size reduction?
    Thanks
    IMAC EyeSight - 15" Powerbook g4   Mac OS X (10.4.5)  

    I have exactly the same problem - and I am on broadband although a fairly slow broadband. I have taken to reducing all my pictures to be posted to Jpegs. Or at least with me it would be only some - about 25% that would be pixellated. I never thought of asking someone with a higher broadband to test to see if OK for her/him.
    Hi - I have a related question. I'm just creating my
    first ever web site - it's only fairly simple for a
    small charity association - and using iWeb has been
    great for this because of its intuivity - is this a
    real word?
    But the only problem is that now the site is at last
    'up there' when I check out the the Photo pages
    neither the thumbnail pics or their fill size
    versions appear correctly - highly pixellated and
    unrecognisable. In fact they look as if they were
    imported at very very low res but in reality it's
    quite the opposite and I was actually worried that
    they could be too high res.
    I am not on Broadband, just a slow dial-up connectin
    - yet a friend with broadbad has just check my site
    and they come out great for him. Any ideas? Is it
    just that I am not on a higher speed connection? If
    so this will be a problem because many visitors to
    the site will be overseas with a slow connection
    also. I'm happy to re-configure my Photos pages with
    smaller images but could do with advice as to what
    would be the best image size and resolution to ensure
    success. Hope someone can help. Thanks.
    PowerBook G4   Mac OS X (10.4.6)
    Powerbook 17"   Mac OS X (10.4.7)  

  • How to insert pic into email response?

    Looks like I can easily insert a pic into a freshly composed email, but I can't find a link to do the same for a response? Can this be done, if so, how? Thanks in advance fir any responses.

    If your picture is held 'elsewhere' then inserting the URL is all that's needed....
    MobileMe helps as an option too because you can then have access to a space that is effectively shared with another machine (Mac/PC) that is accessible to others over the Internet using the same URLs (which may also be password-protected).

  • Inserting a column into JTable

    I can insert a column at the end, and then move it to the position i want it. When i have done this and print out the headers from the columns in the column model, then from index 0 up to (say) 6 are as i want them, with the new column at index 4.
    However, when i add a new column again, then the previously added column has an index of 6 and so isn't displayed in the position i want it.
    I'm using the moveColumn method as I have found people saying to use, it's just it doesn't seem to stick!
    Any ideas?

    Adding a new column to a DefaultTableModel fires a special TableModelEvent. Because of that the JTable reinitializes its TableColumnModel and any column movements are undone.
    You can call "setAutoCreateColumnsFromModel(false)" on the table but then you must update the TableColumnModel manually. The best solution is to build a table model with all necessary columns and to remove all TableColumn-Objekts from the TableColumnModel which should not be visible at first; adding TableColumn objects later wont alter the positions of the other columns.

  • Insert pic in Video

    I have a short video. I want to insert a picture in the middle of the video. Video needs to fade to pic and pic needs to fade back to video while to videos audio continues to play even when the pic is up.
    SUggestions?

    Relatively easy: extract the audio from the video clips. Make sure the audio track is long enough (or the video track is short enough) for the two to match. Use fade-in/fade-out.

  • Inserting rows into a JTable

    Hi everyone,
    I am having a problem with the JTable. Take the following code, for example (the table is initially empty):
    outputsTableModel.addRow(new Object[] { new CodePath(nextNode.getPath()), "<not defined>" });
    CodePath cp = (CodePath)outputsTableModel.getValueAt(0, 0);
    So the first line will add a new row to the table at position 0 (as this is the first row to be added). Immediately after this I wish to retrieve the value a (0,0) and I get an ArrayIndexOutOfBoundsException. Do I need to explicitly say something like:
    "Hey, JTable model, I have just given you a new row so update yourself." or something like that? And if so, how do I do that?
    Thanks in advance.
    Kind regards,
    Ben Deany

    Should I code my own table model? In fact, is it
    generally the case that people code their own table
    models?If you're doing anything that will modify the underlying data in the table model, you should be using your own model. Extending the AbstractTableModel is the easiest way of doing this.
    However, you do have to manage your data storage mechanism yourself. My typical implementation is usually built around a some kind of List, each element being a fixed-size (number of columns) Object[] array.

  • How i insert the values in JTable

    Hi,
    Iam new to the swings i have a problem placing the values in JTable while retriving the values from DataBase .Anybody please suggest me..
    i can retriving the values but how i place the vlaues..
    This is My code
    package com.teamone.healthcare;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.sql.DriverManager;
    import java.sql.Statement;
    import javax.swing.JButton;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.WindowConstants;
    import javax.swing.table.DefaultTableModel;
    import javax.swing.table.TableModel;
    import com.mysql.jdbc.Connection;
    import com.mysql.jdbc.ResultSet;
    * This code was edited or generated using CloudGarden's Jigloo
    * SWT/Swing GUI Builder, which is free for non-commercial
    * use. If Jigloo is being used commercially (ie, by a corporation,
    * company or business for any purpose whatever) then you
    * should purchase a license for each developer using Jigloo.
    * Please visit www.cloudgarden.com for details.
    * Use of Jigloo implies acceptance of these licensing terms.
    * A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
    * THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
    * LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
    public class ClientList extends javax.swing.JFrame {
         private static final long serialVersionUID = 1L;
         private JScrollPane list;
         private JButton view;
         private JButton close;
         private JTable jTable1;
         Connection con = null;
        Statement st = null;
        ResultSet rs = null;
         * Auto-generated main method to display this JFrame
         /*public static void main(String[] args) {
              ClientList inst = new ClientList();
              inst.setVisible(true);
         public ClientList() {
              super();
              initGUI();
              this.setVisible(true);
         private void initGUI() {
              try {
                        list.setBounds(161, 133, 371, 98);
                        list.getHorizontalScrollBar().setPreferredSize(new java.awt.Dimension(10, 59));
                   setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
                   getContentPane().setLayout(null);
              try {
                    Class.forName("com.mysql.jdbc.Driver").newInstance();
                    con = (Connection) DriverManager.getConnection("jdbc:mysql:///healthcare","yenmad","yenmad");
                    st = con.createStatement();
                    rs = (ResultSet) st.executeQuery("SELECT User_id, Username, Citizen_ID, First_Name, Phone FROM register_users");
                    while(rs.next()) {
                      int Userid = rs.getInt(1);
                      String Username = rs.getString(2);
                      String ClientId = rs.getString(3);
                      String ClientName = rs.getString(4);
                      //String Last_Name = rs.getString(5);
                      String ContactNumber = rs.getString(5);
                      System.out.println(Userid + ", " + Username + ", " +ClientId  + "," + ClientName +","+ContactNumber);
                  } catch (Exception e) {
                       System.out.println("Exception: " + e.getMessage());
                        list = new JScrollPane();
                        getContentPane().add(list);
                        list.setBounds(0, 0, 644, 217);
                             TableModel jTable1Model = new DefaultTableModel(
                                  new String[][] { { "", "", "","", "" } },
                                  new String[]{ "UserId", "UserName", "ClientId", "ClientName", "ContactNumber"});
                             jTable1 = new JTable();
                             list.setViewportView(jTable1);
                             jTable1.setModel(jTable1Model);
                        close = new JButton();
                        getContentPane().add(close);
                        close.setText("Close");
                        close.setBounds(518, 231, 63, 28);
                        view = new JButton();
                        getContentPane().add(view);
                        view.setText("View");
                        view.setBounds(441, 231, 63, 28);
                        view.addActionListener(new ActionListener() {
                             public void actionPerformed(ActionEvent evt) {
                                  viewActionPerformed(evt);
                   pack();
                   this.setSize(652, 300);
              } catch (Exception e) {
                   e.printStackTrace();
         private void viewActionPerformed(ActionEvent evt) {
              System.out.println("view.actionPerformed, event=" + evt);
              new ViewClient();
    }

    can i display this table values in vertical .. if yes how can i do that.. please suggest me..
    this is the code iam using but it is displa in horizontally...
    package com.teamone.healthcare;
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.sql.DriverManager;
    import java.util.Vector;
    import javax.swing.JButton;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.WindowConstants;
    import com.mysql.jdbc.Connection;
    import com.mysql.jdbc.ResultSet;
    import com.mysql.jdbc.ResultSetMetaData;
    import com.mysql.jdbc.Statement;
    public class ClientList extends javax.swing.JFrame {
         private static final long serialVersionUID = 1L;
         /*public static void main(String[] args) {
              ClientList inst = new ClientList();
              inst.setVisible(true);
         public ClientList() {
              super();
              initGUI();
              this.setVisible(true);
         private void initGUI() {
              try {
                   setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
                   pack();
                   setSize(600, 500);
                   Vector columnNames = new Vector();
                Vector data = new Vector();
                try
                          this.setSize(500, 400);
                      //  Connect to the Database
                      Class.forName("com.mysql.jdbc.Driver");
                      Connection connection = (Connection) DriverManager.getConnection("jdbc:mysql:///healthcare","yenmad","yenmad" );
                      //  Read data from a table
                      String sql = "Select User_id, Username, Citizen_ID, First_Name, Last_Name, Phone from register_users";
                      Statement stmt = (Statement) connection.createStatement();
                      ResultSet rs = (ResultSet) stmt.executeQuery( sql );
                      ResultSetMetaData md = (ResultSetMetaData) rs.getMetaData();
                      int columns = md.getColumnCount();
                      //  Get column names
                      for (int i = 1; i <= columns; i++)
                       columnNames.addElement( md.getColumnName(i) );
                      //  Get row data
                      while (rs.next())
                            Vector row = new Vector(columns);
                            for (int i = 1; i <= columns; i++)
                                  row.addElement( rs.getObject(i) );
                            data.addElement( row );
                      rs.close();
                      stmt.close();
                catch(Exception e)
                      System.out.println( e );
                //  Create table with database data
                JTable table = new JTable(data, columnNames);
                JScrollPane scrollPane = new JScrollPane( table );
                getContentPane().add( scrollPane );
                JPanel buttonPanel = new JPanel();
                getContentPane().add( buttonPanel, BorderLayout.SOUTH );
                buttonPanel.setPreferredSize(new java.awt.Dimension(200, 66));
                        JButton View = new JButton();
                        buttonPanel.add(View);
                        View.setText("View");
                        View.setLayout(null);
                        View.addActionListener(new ActionListener() {
                             public void actionPerformed(ActionEvent evt) {
                                  ViewActionPerformed(evt);
                        JButton Close = new JButton();
                        buttonPanel.add(Close);
                        Close.setText("Close");
                        Close.addActionListener(new ActionListener() {
                             public void actionPerformed(ActionEvent evt) {
                                  CloseActionPerformed(evt);
                        } catch (Exception e) {
                   e.printStackTrace();
         private void CloseActionPerformed(ActionEvent evt) {
              System.out.println("Close.actionPerformed, event=" + evt);
              this.setVisible(false);
         private void ViewActionPerformed(ActionEvent evt) {
              System.out.println("View.actionPerformed, event=" + evt);
              new ViewClient();
    }

  • JTable inserts too many rows

    Hello all again,
    I am getting this very time consuming error when I insert rows into my JTable. Everytime I insert a new row into the DefaultTableModel for this jtable, it will add an extra blank row at the bottom. And always, when I delete from the JTable, it will still leave more rows visible than should be on the jtable. This is how my code is set up:
    I create a string array of my column headers,
    String colHeader [] = new String[]{"1", "2", "3"};
    DefaultTableModel dfltTblMdl = new DefaultTableModel(null, colHeader);
    JTable jtbl = new JTable(dfltTblMdl);
    //Now later in my code, I can press a Refresh button or when new sockets connect to my program, their connection information is displayed into the jtable as follows:
    this.dfltTblMdl.setRowCount(numConnectedSockets);
    for(int i = 0; i < numConnectedSockets; i++)
    this.dfltTblMdl.insertRow(i,(new Object[]{"etc"...}));
    The insert is working fine, it's placing the new information into the default table model which is showing up in my JTable, however, I am also getting blank rows that should not be displayed on the JTable. Further, when an socket disconnects, I call a refresh method to remove everything from the default model and repopulate again, however, some of the data from a previous but non-existent connection lingers on the JTable.
    I've tried the fireTableRowsUpdated methods, fireTableRowsInserted, fireTableDataChanged methods, but non of these seem to get rid of the extra rows placed at the bottom when a new connection is received, nor eliminate the old data from the jtable when I refresh everything.
    I am thinking perhaps is has something to do with data stored in the DefaultTableModel...but I'm not sure. Thanks soooooooooooo much in advance for your expertise in this matter!

    Hey, great post about my constructor. Although it was working, I found out that the reason I was getting more rows was because I was using the .setRowCount() method incorrectly. It is adding and removing from the JTable just fine!!!! Thank you!
    As soon as we fix one problem, as usual, another compounds itself to continue to absorb more time. Now, if I allow the user to sort jtable, and there exist elements in the the tablemodel, then it updates fine. However, if I when all elements are removed from the table, and then the user attempts to click on one of the sort column headers, its throwing the following exception: NOTE: this is only occurring when the sort is enabled but it tries to sort an empty table... anyone know how to fix this?
    Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: -1
         at java.util.Vector.elementAt(Unknown Source)
         at javax.swing.table.DefaultTableColumnModel.getColumn(Unknown Source)
         at javax.swing.plaf.basic.BasicTableHeaderUI.getHeaderRenderer(Unknown Source)
         at javax.swing.plaf.basic.BasicTableHeaderUI.paintCell(Unknown Source)
         at javax.swing.plaf.basic.BasicTableHeaderUI.paint(Unknown Source)
         at javax.swing.plaf.ComponentUI.update(Unknown Source)
         at javax.swing.JComponent.paintComponent(Unknown Source)
         at javax.swing.JComponent.paint(Unknown Source)
         at javax.swing.JComponent.paintToOffscreen(Unknown Source)
         at javax.swing.BufferStrategyPaintManager.paint(Unknown Source)
         at javax.swing.RepaintManager.paint(Unknown Source)
         at javax.swing.JComponent._paintImmediately(Unknown Source)
         at javax.swing.JComponent.paintImmediately(Unknown Source)
         at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
         at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
         at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
         at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
         at java.awt.event.InvocationEvent.dispatch(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)

  • How to enable JScrollPane in a cell of the JTable

    Hi,
    I am able to place the components into the cell of the JTable. But I am unable to interact with the components like JTable or JComboBox after inseting them into a cell of the JTable.
    This was the one of the Scenario:
    Step 1: I created One JTable named as "insertTable"and adding to JScrollPane
    Step 2: I'm able to inserted the newly created JTable ("insertTable") in to a cell of another JTable(like table inserting a table) using TableCellRenderer.
    here was the problem. I am able to insert the newly created table into the cell. the "insertTable" size is greater the Cell size. So, the "insertTable" is appering with Horizantal and Vertical Scrollbars because the "insertTable" is added to JScrollBar. but I am unable to move the scrollbars.
    please any one help me for this.

    you still didn't try to learn the difference between cellEditor vs cellRenderer - as you were advised to do more than once in recent posts.
    If you do, the answer will be obvious (to you :-). As long as you don't there's nothing to help
    Cheers
    Jeanette

Maybe you are looking for

  • Dead Keys on Lenovo W520 built-in keyboard after Windows 7 (64bit) Update

    After my Windows 7 update, I have several dead keys.  Left Alt, Up Arrow, Print Screen, F5, F6, and the ThinkVantage Keys are all dead.  Orginally I thought it was just Windows, but after booting into my Linux OS, I run into the same issues.  I have

  • Closed captions not appearing

    I opened my captivate project in the trial version of captivate 6 and now the closed captions do not appear in the output. They worked in the 5.5. version. I ensured that all the appropriate CC settings in the Slide Audio and the Skin Editor are sele

  • Error on starting WebLogic

    Hi, When WebLogic try to start, it shows the following messages: Enterprise Manager and Console work fine, but Workspace doesn't work, it doesn't accept to login with "weblogic" user. Não é possível carregar o elemento "persistence-config" MDS-01370:

  • Get cursor on a control table

    Hi guys, i created a control table with the ti_master inside. im trying to get the postion when double click, i already got the event, F2, with PICK, my problem is that i dont know how to get the row and the column that was clicked, im using get curs

  • Problem with iPhone 5 calender

    I have an iPhone 5 with iOS8; I am unable to set dates in my calendar. Any ideas?  Jim