JCheckBox clicking problem in JTable

Hi,
I have a column of JCheckBox in a JTable. The JTable is only used to layout the controls(for lagecy reason). The JCheckBox has an item change listener attached. The problem is that OCCASIONALLY when the JCheckBox[i] was clicked, the debug in itemStateChanged show the source object was NOT JChechBox, it was JCheckBox[i+1] or JCheckBox[i-1]. In other word, it was the check box in the previous or next row changed state.
Has anybody experienced similar problems? Is it a problem of JTable dispatching mouse click event?
How to solve the problem?
Thanks

I'm not sure why you get the results you do, but instead of adding a change listener to the JCheckBox you could add a TableModelListener to the TableModel. This will fire an event whenever any data is changed. This thread shows a simple example:
http://forum.java.sun.com/thread.jsp?forum=57&thread=425540

Similar Messages

  • Colum Resizing problem in JTable

    HI All,
    I am facing a problem with JTable while resizing the colum. when user clicks and drags to resize a column, the column width increases continuously till the mouse button is released. I am sure this sounds like a vague description,
    (eg)
    when I click on a column boundary and drag, the column width is getting increase beyond where the cursor of the mouse is. In a normal table, when I click and drag, the column resizes to the size that I have the mouse position at, and gets set to the width when I release the mouse. But right now, when I click the mouse and drag to say a width of 50 from 10, it is still increasing beyond 50 and stops when I release the mouse at about 100 or higher. I hope this is a clearer explanation.
    In Java 1.2, it works fine. but in java 1.4...
    If Anyone knows, please let me know
    Advance thanks for any comments and suggestion..
    Best Regards,
    Muthu

    I solved this problem... Problem is getPreferredSize() method. I override this method
    Thank u for ur suggestion..
    Best Regards,
    Muthu

  • Problem of JTable's column setPreferredWidth.

    Hi All,
    I have a problem about JTable,I want to set the preferredwidth for every column when the table is first established,but it is always failed.
    Could someone tell me the root?Thanks!
    import java.awt.*;
    import javax.swing.*;
    public class MixerTest2 extends JFrame {
    public MixerTest2() {
    super("Customer Editor Test");
    setSize(600,160);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    JTable typeTable=new JTable();
    typeTable=new JTable(new String [][] {
    {"312fs", "33232", "32", "32"},
    {"3212fsdfa12", "3322", "32", "32"},
    {"3212fa12", "321212", "321212", "321212"},
    {"3212gsds12", "321212", "321212", "321212"}
    new String [] {
    "Title 1", "Title 2", "Title 3", "Title 4"
    typeTable.setAutoResizeMode(JTable.AUTO_RESIZE_NEXT_COLUMN);
    typeTable.getColumnModel().getColumn(0).setPreferredWidth(10);
    typeTable.getColumnModel().getColumn(1).setPreferredWidth(30);
    JScrollPane typeTableScrollPane=new JScrollPane(typeTable);
    getContentPane().add(typeTableScrollPane);
    public static void main(String args[]) {
    MixerTest2 mt = new MixerTest2();
    mt.setVisible(true);
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.
    The problem is that the size of the frame is greater than the size of the table so the widths of all the columns get adjusted after you specify the original default size.
    Your code should be something like:
    typeTable.setPreferredScrollableViewportSize(typeTable.getPreferredSize());
    JScrollPane typeTableScrollPane=new JScrollPane(typeTable);
    mt.pack();
    mt.setVisible(true);Or you might be able to use my [Table Column Adjuster|http://www.camick.com/java/blog.html?name=table-column-adjuster] which will resize the columns automatically.

  • Hi!!! A Problem in JTable

    HI,
    I have a problem in JTable.I have a Jtable and a button named validate.My JTable first displays a set of rows and colums.if we name the colns as a,b and c. when i click the validate button i will take the values of a1 and b1 and do some validations. If it is in correct position then the row remains as it is else i will change the value of b1 to a1 position and vice versa. This happens in a loop till the end and the data vector of the table gets changed accordingly.Now the problem is suppose if there are 10 rows and the value changes in row 1,5,7 thn i need that rows alone to be colored while the button ends its action.Finally the JTable should be viewed as row 1,5,7 colored and others in their default color....
    Please help me...
    Message was edited by:
    tis-is-hari

    You will have to create your own Renderer or use a table like JXTable from swing labs that allows highlighting.

  • Problem with JTable in a JScrollPane

    Hello all,
    I have a problem using JTable, that the number of columns is very big,
    and the JScrollPane shows only vertical ScrollBar, isn't there any way to show a horizontal ScrollBar, to show the other columns without being bunched.
    Thanks in advance.

    table.setAutoResizeMode( JTable.AUTO_RESIZE_OFF );

  • Selection Problem with JTable

    Hello,
    i have a selection problem with JTable. I want to allow only single cell selection and additionally limit the selection to the first column.
    I preffered the style from MS Outlook Express where you can select the email accounts to edit.
    It is a table like this:
    Account name  |   Type  |   ...
    --------------|---------|---------------------
    Hotmail       |   POP3  |
    GMX           |   IMAP  |The selection should be only avaibable at 'Hotmail' or 'GMX' - not at 'POP3', 'IMAP' or as complete row selection.
    Please help me!
    Thanks.
    Warlock

    Maybe this will helpimport java.awt.*;
    import javax.swing.*;
    public class Test3 extends JFrame {
      public Test3() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Container content = getContentPane();
        String[] head = {"One", "Two"};
        String[][] data = {{"R1-C1", "R1-C2"}, {"R2-C1", "R2-C2"}};
        JTable jt = new JTable(data, head);
        jt.getColumnModel().setSelectionModel(new MyTableSelectionModel());
        content.add(new JScrollPane(jt), BorderLayout.CENTER);
        jt.setCellSelectionEnabled(true);
        jt.setRowSelectionAllowed(false);
        jt.setColumnSelectionAllowed(false);
        setSize(300, 300);
        setVisible(true);
      public static void main(String[] arghs) { new Test3(); }
    class MyTableSelectionModel extends DefaultListSelectionModel {
      public void setSelectionInterval(int index0, int index1) {
        super.setSelectionInterval(0, 0);
    }

  • Double click on a JTable row.

    I got and run a sample about double click on a JTable and it works fine. This sample defines a TableModel as shown at the end this note.
    On the other hand, I have an application in which I have defined a JTable
    using the DefaultTableModel as follows :
    DefaultTableModel dtm = new DefaultTableModel(data, names);
    JTable table  = new JTable(dtm);  where data and names are String arrays.
    Of course the mouse listener stuffs have been also specified.
    table.addMouseListener(new MouseAdapter(){
         public void mouseClicked(MouseEvent e){
          if (e.getClickCount() == 2){
             System.out.println(" double click" );
         } );Because the difference with the sample was the table model,
    I changed it with the DefaultTableModel class. At this point, the Double click does not work anymore.
    So I gues it should be an option which prevents double click to work.
    I thought of using mousePress() instead of mouseClick(), but it's very dangerous (I tried). . If by error the user clicks twice (instead of only once) the mousePress method is invoked twice for the same entry
    My question is now simple, may I use double click on a JTable with the default table model. If so, what I have to do ?
    Thanks a lot
    Gege
    TableModel dataModel = new AbstractTableModel() {
         public int getColumnCount() { return names.length; }
         public int getRowCount() { return data.length;}
         public Object getValueAt(int row, int col) {return data[row][col];}
         public String getColumnName(int column) {return names[column];}
         public Class getColumnClass(int col) {return getValueAt(0,col).getClass();}
         public void setValueAt(Object aValue, int row, int column) {
           data[row][column] = aValue;
         };

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class ClickIt extends MouseAdapter
        public void mousePressed(MouseEvent e)
            JTable table = (JTable)e.getSource();
            Point p = e.getPoint();
            if(e.getClickCount() == 2)
                System.out.println("table.isEditing = " + table.isEditing());
            int row = table.rowAtPoint(p);
            int col = table.columnAtPoint(p);
            String value = (String)table.getValueAt(row,col);
            System.out.println(value);
        private JTable getLeftTable()
            final String[] names = { "column 1", "column 2", "column 3", "column 4" };
            final Object[][] data = getData("left");
            TableModel dataModel = new AbstractTableModel() {
                public int getColumnCount() { return names.length; }
                public int getRowCount() { return data.length;}
                public Object getValueAt(int row, int col) {return data[row][col];}
                public String getColumnName(int column) {return names[column];}
                public Class getColumnClass(int col) {return getValueAt(0,col).getClass();}
                public void setValueAt(Object aValue, int row, int column) {
                    data[row][column] = aValue;
            JTable table = new JTable(dataModel);
            return configure(table);
        private JTable getRightTable()
            String[] colNames = { "column 1", "column 2", "column 3", "column 4" };
            JTable table = new JTable(new DefaultTableModel(getData("right"), colNames));
            return configure(table);
        private Object[][] getData(String s)
            int rows = 4, cols = 4;
            Object[][] data = new Object[rows][cols];
            for(int row = 0; row < rows; row++)
                for(int col = 0; col < cols; col++)
                    data[row][col] = s + " " + (row*cols + col + 1);
            return data;
        private JTable configure(JTable table)
            table.setColumnSelectionAllowed(true);
            table.setCellSelectionEnabled(true);
            table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            table.setPreferredScrollableViewportSize(table.getPreferredSize());
            table.addMouseListener(this);
            return table;
        private JPanel getContent()
            JPanel panel = new JPanel(new GridLayout(1,0,0,5));
            panel.add(new JScrollPane(getLeftTable()));
            panel.add(new JScrollPane(getRightTable()));
            return panel;
        public static void main(String[] args)
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setContentPane(new ClickIt().getContent());
            f.pack();
            f.setVisible(true);
    }

  • Problem in JTable cell renderer

    Hi
    One problem in JTable cell. Actually I am using two tables while I am writing renderer for word raping in first table .. but it is affected in last column only remain is not being effected�. Please chaek it out what is exact I am missing�
    Thanks
    package com.apsiva.tryrowmerge;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.ArrayList;
    import java.util.EventObject;
    import java.util.Hashtable;
    import java.net.*;
    import javax.swing.*;
    import javax.swing.border.Border;
    import javax.swing.border.EmptyBorder;
    import javax.swing.event.*;
    import javax.swing.table.TableCellEditor;
    import javax.swing.table.TableCellRenderer;
    import javax.swing.table.TableColumn;
    class Item_Details extends JFrame {
        ApsJTable itemTable = null;
         ApsJTable imageTable = null;     
         ArrayList data = new ArrayList();
         String[] columns = new String[2];
         ArrayList data1 = new ArrayList();
         String[] columns1 = new String[2];
         ItemTableModel itemTableModel = null;
         ItemTableModel itemTableModel1 = null;
         public Item_Details()
              super("Item Details");          
             this.setSize(600,100);
             this.setBackground(Color.WHITE);
              this.setVisible(true);
             init();          
         private void init(){
              ////////////// Get data for first Table Model  ////////////////////////////
              data = getRowData();
              columns = getColData();
              System.out.println(columns[0]);
             itemTableModel = new ItemTableModel(data,columns);
             /////////////Get Data for Second Table Model //////////////////////////////
              try{
                        data1 = getRowData1();
                 }catch(Exception e){}
              columns1 = getColumns1();
             itemTableModel1 = new ItemTableModel(data1,columns1);
             ///////////// Set Data In Both Table Model //////////////////////////////////
              itemTable = new ApsJTable(itemTableModel);
              imageTable = new ApsJTable(itemTableModel1);
              this.itemTable.setShowGrid(false);
              this.imageTable.setShowGrid(false);
              this.itemTable.setColumnSelectionAllowed(false);
              this.imageTable.setColumnSelectionAllowed(false);
              System.out.println(itemTable.getColumnCount());
              this.imageTable.setRowHeight(getImageHeight()+3);
              JScrollPane tableScrollPane = new JScrollPane(this.imageTable,JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
              tableScrollPane.setRowHeaderView(this.itemTable);
              //itemTable.getColumnModel().getColumn(0).setMaxWidth(200);
              itemTable.getColumnModel().getColumn(0).setPreferredWidth(200);
              itemTable.getColumnModel().getColumn(1).setPreferredWidth(600);
              tableScrollPane.getRowHeader().setPreferredSize(new Dimension(800, 0));
              itemTable.getTableHeader().setResizingAllowed(false);
              itemTable.getTableHeader().setReorderingAllowed(false);
              itemTable.setColumnSelectionAllowed(false);
              //itemTable.setRowHeight(25);
              itemTable.setCellSelectionEnabled(false);
              itemTable.setFocusable(false);
              imageTable.getTableHeader().setReorderingAllowed(false);
              imageTable.setFocusable(false);
              imageTable.setCellSelectionEnabled(false);
              //tableScrollPane.setOpaque(false);
              itemTable.setAutoCreateColumnsFromModel(false);
              int columnCount = itemTable.getColumnCount();
              for(int k=0;k<columnCount;k++)
                   TableCellRenderer renderer = null;
                   TableCellEditor editor = null;
                   renderer = new TextAreaCellRenderer();     // NEW
              //     editor = new TextAreaCellEditor();     
              //     TableColumn column = new TableColumn(k,itemTable.getColumnModel().getColumn(k).getWidth(),renderer, editor);
                   System.out.println(k);
                   itemTable.getColumnModel().getColumn(k).setCellRenderer(renderer);          
                   //itemTable.getColumnModel().getColumn(k).setCellEditor(editor);
                   /*itemTable.getColumnModel().getColumn(1).setCellRenderer(new TextAreaCellRenderer());
                   itemTable.getColumnModel().getColumn(1).setCellEditor(new TextAreaCellEditor());*/
    //               itemTable.setShowGrid(false);
                   //itemTable.addColumn(column);
                   //itemTable.getColumnModel().getColumn(k).setCellRenderer(new MultiLineCellRenderer());
                   //itemTable.getColumnModel().getColumn(k).setCellEditor(new TextAreaCellEditor());
    ////////////---------------------- Here background color is being set--------------//////////////////
              this.imageTable.getParent().setBackground(Color.WHITE);
              this.itemTable.getParent().setBackground(Color.WHITE);
              tableScrollPane.setCorner(ScrollPaneConstants.UPPER_LEFT_CORNER,this.itemTable.getTableHeader());
              getContentPane().add(tableScrollPane,BorderLayout.CENTER);
              getContentPane().setVisible(true);
         public static void main(String[] str){
              com.incors.plaf.alloy.AlloyLookAndFeel.setProperty("alloy.licenseCode", "2005/05/28#[email protected]#1v2pej6#1986ew");
              try {
                javax.swing.LookAndFeel alloyLnF = new com.incors.plaf.alloy.AlloyLookAndFeel();
                javax.swing.UIManager.setLookAndFeel(alloyLnF);
              } catch (javax.swing.UnsupportedLookAndFeelException ex) {
              ex.printStackTrace();
              Item_Details ID = new Item_Details();
              ID.setVisible(true);
    public ArrayList getRowData()
         ArrayList rowData=new ArrayList();
         Hashtable item = new Hashtable();
         item.put(new Long(0),new String("Item No:aaaaaaa aaaaaaaa aaaaaaaaa aaaaaa"));
         item.put(new Long(1),new String("RED-1050"));
         rowData.add(0,item);
         item = new Hashtable();
         item.put(new Long(0),new String("Description:rt r trtrt rttrytrr tytry trytry tr tr rty thyjyhjhnhnhgg hhjhgjh"));
         item.put(new Long(1),new String("SYSTEM 18 mbh COOLING 13 mbh HEATING 230/208 v POWER AIRE "));
         rowData.add(1,item);
         item = new Hashtable();
         item.put(new Long(0),new String("Stage:"));
         item.put(new Long(1),new String("Draft"));
         rowData.add(2,item);
         item = new Hashtable();
         item.put(new Long(0),new String("Price: "));
         item.put(new Long(1),new String("999.00"));
         rowData.add(3,item);
         item = new Hashtable();
         item.put(new Long(0),new String("Features:"));
         item.put(new Long(1),new String("SYSTEM COOLING & HEATING 12 mbh 230/208 v POWER AIRE SYSTEM1234 COOLING & HEATING 12 mbh 230/208 v POWER AIRE "));
         rowData.add(4,item);
         item = new Hashtable();
         item.put(new Long(0),new String("Features:"));
         item.put(new Long(1),new String("SYSTEM COOLING & HEATING 12 mbh 230/208 v POWER AIRE SYSTEM1234 COOLING & HEATING 12 mbh 230/208 v POWER AIRE "));
         rowData.add(5,item);
         item = new Hashtable();
         item.put(new Long(0),new String("Features:"));
         item.put(new Long(1),new String("SYSTEM COOLING & HEATING 12 mbh 230/208 v POWER AIRE SYSTEM1234 COOLING & HEATING 12 mbh 230/208 v POWER AIRE "));
         rowData.add(6,item);
         /*item.put(new Long(0),new String("Family Sequence"));
         item.put(new Long(1),new String("8.00"));
         rowData.add(5,item);
         item.put(new Long(0),new String("Family Sequence"));
         item.put(new Long(1),new String("8.00"));
         rowData.add(6,item);
         item.put(new Long(0),new String("Family Sequence"));
         item.put(new Long(1),new String("8.00"));
         rowData.add(7,item);
         return rowData;
    public String[] getColData()
         String[] colData = new String[]{"Attribute","Value"};
         return colData;
    public ArrayList getRowData1()throws MalformedURLException{
         ArrayList rowData = new ArrayList();
         Hashtable item = new Hashtable();
         String str = new String("http://biis:8080/assets/PRIMPRIM/Adj_BeacM_Small.jpg");
         URL url = new URL(str);
         ImageIcon ic = new ImageIcon(url);
         ImageIcon scaledImage = new ImageIcon(ic.getImage().getScaledInstance(getImageHeight(), -1,Image.SCALE_SMOOTH));
         item.put(new Long(0), scaledImage);
         rowData.add(0,item);
         String str1 = new String("http://biis:8080/assets/PRIMPRIM/Adj_BeacM_Small.jpg");
         URL url1 = new URL(str1);
         ImageIcon ic1 = new ImageIcon(url1);
         ImageIcon scaledImage1 = new ImageIcon(ic1.getImage().getScaledInstance(120, -1,Image.SCALE_DEFAULT));
         item.put(new Long(0),scaledImage1);
         rowData.add(1,item);
         return rowData;
    public String[] getColumns1(){
         String[] colData = new String[]{"Image"}; 
         return colData;
    public int getImageHeight(){
         ImageIcon ic = new ImageIcon("c:\\image\\ImageNotFound.gif");
         return ic.getIconHeight();
    class TextAreaCellRenderer extends JTextArea implements TableCellRenderer
         public TextAreaCellRenderer() {
              setEditable(false);
              setLineWrap(true);
              setWrapStyleWord(true);
         public Component getTableCellRendererComponent(JTable table,
              Object value, boolean isSelected, boolean hasFocus,
              int nRow, int nCol)
              if (value instanceof String)
                   setText((String)value);
              // Adjust row's height
              int width = table.getColumnModel().getColumn(nCol).getWidth();
              setSize(width, 1000);
              int rowHeight = getPreferredSize().height;
              if (table.getRowHeight(nRow) != rowHeight)
                   table.setRowHeight(nRow, rowHeight);
              this.setBackground(Color.WHITE);
              return this;

    I think Problem is between these code only
    for(int k=0;k<columnCount;k++)
                   TableCellRenderer renderer = null;
                   TableCellEditor editor = null;
                   renderer = new TextAreaCellRenderer();
                                                                itemTable.getColumnModel().getColumn(k).setCellRenderer(renderer);or in this renderer
    class TextAreaCellRenderer extends JTextArea implements TableCellRenderer
         public TextAreaCellRenderer() {
              setEditable(false);
              setLineWrap(true);
              setWrapStyleWord(true);
         public Component getTableCellRendererComponent(JTable table,
              Object value, boolean isSelected, boolean hasFocus,
              int nRow, int nCol)
              if (value instanceof String)
                   setText((String)value);
              // Adjust row's height
              int width = table.getColumnModel().getColumn(nCol).getWidth();
              setSize(width, 1000);
              int rowHeight = getPreferredSize().height;
              if (table.getRowHeight(nRow) != rowHeight)
                   table.setRowHeight(nRow, rowHeight);
              this.setBackground(Color.WHITE);
              return this;
    }

  • There is a screen clicking problem in my iPhone 5c..what should I do?

    There is a glass clicking problem in phone 5c ..I got it replaced once... But the replaced iPhone also has started the problem now...what should I do now?

    Go and get it replaced again...there is nothing else you can do

  • Samsung LED LCD's and the notorious "clicking" problems?

    Has anyone had or heard of the new LED LCD's having the well known "clicking" problem that the LCD's have had?

    A clicking problem? I have never heard nor have I ever experianced any such issue. If you could, please go into more detail.
    Please note that whatever I state in these forums is not a direct response from Best Buy or Geek Squad. My posts are just my own personal insights.

  • They fixed the right click problem, but now there is a bigger problem

    after updating, I can use my right click perfectly on Windows XP. however, my windows XP starts to restart very often-which means the "blue-sceen" comes out very often. I believe many poeple has this problem because I had already read couple of complains...Well...I hope apple can fix it soon.

    I could not right click on my macbook's Precision aluminum unibody enclosure under windows xp, and after updating the trobubleshooter, it works. However, my windows starts to restart again and again (the blue screen) and it says it is because the applemtp.sys has some problems. I read couple of others people's experiences on the Internet, and they all so it started to happen after they fix the right click problem.

  • Beginner - mouse over IE line -  and click problem

    My test swf - -
    http://www.jennyweir.com/testSite/
    How would I remove that white mouseover white line near the
    edges of the page (as seen on IE7)
    I made the swf full screen to try to get it to dissapear -
    but full screen is apparently only nearly full screen and it is
    still there
    I would like to learn how to make an swf which can live
    seamlessly in a matching html page so would appreciate knowing what
    to do. There is a setting I chose which I thought would fix it
    (show border) but it has not worked
    Also - click problem:
    in Flash, I made a fill layer into a button (100% size also
    and under the visible elements ) so that I could attach a goto url
    action (up)
    on this swf you have to click twice to go to the url
    I dont follow how this has come to be
    appreciate any pointers
    gav

    Hi Gavlong
    Did you try adding the background color parameter in the HTML
    of your page? This is different than the background in the Flash
    file. I looked at the source for your page and I didn't see it.
    Regarding your double-click problem it may be due to an
    Internet Explorer update from earlier in the year. I've read a few
    bits about how for some interactive web apps (Flash is included in
    the list of affected programs) the user needs to 'activate' the
    control by pressing SPACEBAR or ENTER. That would explain the need
    for the second click. Apparently there's a way to enable the
    control from your web page by using and external .js file but I
    haven't implemented it. Here are a couple of related
    links...hopefully they are of some help:
    http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/activati ng_activex.asp
    http://msdn.microsoft.com/ieupdate/
    http://www.adobe.com/devnet/activecontent/articles/devletter.html
    -WD

  • Problems with JTable

    Hi All,
    I am facing some problems in JTable :
    1) How to remove all lines between cells, neither i should have column nor row lines....there should not be any lines between any cell at all.
    2) If i select a perticular cell, complete row is getting selected with a blue background, that should not happen at all.....row should not get select....
    3) How to make a cell non editable.
    Regards,
    Ravi

    1) Read the API. Check out the set??? methods until you fine what you want
    2) Read the API. Check out the methods that deal with row and column selection
    3) Override isCellEditable(...) method of JTable or DefaultTableModel

  • Cell Editor Problem in JTable

    I have a problem using JTable. I have a requirement like each specified cell will have different editors like JtextField or Jcombobox as per some condition. I am building the rows at run time. Number of rows may vary as per condition.
    can anyone guide me what to do?
    thanks

    Override the getCellEditor(...) method to return the appropriate editor.

  • Changing mouse click behavior on JTable

    Hi everybody,
    The default behavior of a mouse click on a jTable is selection of the cell.
    I would like to change the behavior so when the user clicks once on the cell, the content can be marked and is ready to change. That would give the user the same feeling as Excel.
    Is there any way that I can do this without writing a new mouse/event handler?
    thanks,

    With a call to getSelectionModel() of JTable, you can get a reference to the ListeSelectionModel.
    This is in fact an instance of DefaultListSelectionModel, which allows you to set a new listener object using addListSelectionListener(ListSelectionListener l).
    All you have to do then is implement a custom ListSelectionListener which handles events as you want.
    Unfortunately there isnt going to be a way of avoiding writing a Listener, but this is how you would go about it.
    colr__

Maybe you are looking for

  • How to get All Users from OID LDAP

    Hi all, I have Oracle Internet Directory(OID) and have created the users in it manually. Now I want to extract all the users from OID. How can I get Users from OID?? Any response will be appritiated. If some one could show me demo code for that I sha

  • How to give less ressources to the JVM ?

    Hello, i am running a chatserver which is witten in Java. Unfortunately, it grows up to nearly 100% of the ressources of the server! I am programming a completely new chatserver which one shall not use so many ressources, but meaningwhile, i would li

  • Helping making countdown in Motion 3

    Hello I am trying to make a new years countdown in motion 3. I tried using the Templete "Clockwork" from motion library and set the timing to 1:00 in the inspector. The problem is after 10 seconds the template disappears. Also what is the best way to

  • Render files missing-after duplication and also after moving

    I have to replace a drive, which is still working well, so i went ahead and tried to move libraries with all its content (Events,projects,reneder files), which doesnt exist as an option... as far as i was able to figure this out.... then i went ahead

  • Traveling to Italy with a Galaxy S4

    Hi, I'm traveling with my wife to Italy in April, and I'm trying to understand if our Galaxy S4s will be able to use an Italian SIM card from a prepaid phone to avoid the international roaming charges. The internet (and this forum) seem to be all ove