About JCheckBox in a JTable.

Hi,
In my JTable, one of the column uses checkbox as cell editor.
I like to know how to get the row index of the row where the clicked checkbox is in.
Thanks
Stephen

Hi,
TableColumnModel tcm = jTable1.getColumnModel();
JUTableLOVEditor jTableLOVEditor = (JUTableLOVEditor) tcm.getColumn(0).getCellEditor();
JComboBox component = (JComboBox) jTableLOVEditor.getComponent();
component.addFocusListener(new FocusListener(){
public void focusGained(FocusEvent e) {
DCIteratorBinding dciter = (DCIteratorBinding)panelBinding.get("EmployeesView1Iterator");
System.out.println(dciter.getCurrentRowIndexInRange());
public void focusLost(FocusEvent e) {
Frank

Similar Messages

  • How do I add a JCheckBox to a JTable - URGENT HELP NEEDED

    Hello All,
    This is kicking my butt. I need to create a JTable that I can dynamically add and delete rows of data to and this table must contain a JCheckBox which I can read the value of. I've been able to find examples out there that provides the ability to have a JCheckBox in the JTable, but do not also provide the function to add / delete rows from the JTable. I need to have both funtions in my table. Can somebody out there please help me with this?
    Here's a simple example that I'm working with as a test to figure this out. This example has the functionality to add rows of data.
    Thanks in advance.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.JFrame;
    import javax.swing.JTable;
    import javax.swing.table.*;
    public class TableTest extends JFrame implements ActionListener
         JButton btnAdd;
         BorderLayout layout;
         DefaultTableModel model;
         public static void main(String[] args)
              TableTest app = new TableTest();
              app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         public TableTest()
              super("Table Example");
              layout = new BorderLayout();
              Container container = getContentPane();
              container.setLayout(layout);
              btnAdd = new JButton("Add");
              btnAdd.addActionListener(this);
              model = new DefaultTableModel();
              JTable table = new JTable(model);
              // Create a couple of columns
              model.addColumn("Col1");
              model.addColumn("Col2");
              // Append a row
              model.addRow(new Object[] { "v1", "v2" });
              model.addRow(new Object[] { "v3", "v4" });
              JScrollPane scrollPane = new JScrollPane(table);
              container.add(btnAdd, BorderLayout.NORTH);
              container.add(scrollPane,BorderLayout.CENTER);
              setSize(300, 200);
              setVisible(true);
         public void actionPerformed(ActionEvent e)
              if (e.getSource() == btnAdd)
                   model.addRow(new Object[]{"Test", new Boolean(true)});
    }

    I got it, I added the public Class getColumnClass to new DefaultTableModel(). Here it is for your viewing pleasure.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.JFrame;
    import javax.swing.JTable;
    import javax.swing.table.*;
    public class TableTest extends JFrame implements ActionListener
         JButton btnAdd;
         BorderLayout layout;
         DefaultTableModel model;
         JTable table;
         public static void main(String[] args)
              TableTest app = new TableTest();
              app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         public TableTest()
              super("Table Example");
              layout = new BorderLayout();
              Container container = getContentPane();
              container.setLayout(layout);
              btnAdd = new JButton("Add");
              btnAdd.addActionListener(this);
              model = new DefaultTableModel()
                   public Class getColumnClass(int col)
                        switch (col)
                             case 1 :
                                  return Boolean.class;
                             default :
                                  return Object.class;
              table = new JTable(model);
              // Create a couple of columns
              model.addColumn("Col1");
              model.addColumn("Col2");
              // Append a row
              model.addRow(new Object[] { "v1", new Boolean(false)});
              model.addRow(new Object[] { "v3", new Boolean(false)});
              JScrollPane scrollPane = new JScrollPane(table);
              container.add(btnAdd, BorderLayout.NORTH);
              container.add(scrollPane, BorderLayout.CENTER);
              setSize(300, 200);
              setVisible(true);
         public void actionPerformed(ActionEvent e)
              if (e.getSource() == btnAdd)
                   model.addRow(new Object[] { "Karl", new Boolean(true)});

  • Capturing events from a JCheckBox in a JTable cell

    I am trying to capture item state changed event from a JCheckbox in a JTable. When user selects checkbox I do insert in database and on deselect I do delete from database. The item state changed event is not firing correctly...can you please tell me what I am doing wrong. My JTable uses CustomModel which is used by many other apps. So I can not really modify CustomModel only to work with my JTable. Here is my code.
    public class MyClass extends JPanel
    .....some code to add panel, jscorollpane, etc.
    ResultSet res;
    GUI gui; //Custom Class to deal with different GUI layouts
    JTable myJTable = new JTable();
    GUI.CustomModel custModel;
    public void init()
         displayJTable();
    attachCheckBoxListeners();
    private void displayForms()
         res = //resultset from DB
    Vector cols = new Vector(10);
    cols.addElement(new Integer(1);
    gui.DisplayResultSetinTabel(res, myJtable, cols, null);
    custModel= (GUI.CustomModel) ((TableSorter) myJTable.getModel()).getModel();
    custModel.setEditableColumn(0, true);
    //Attach CheckBox Listener to all the checkbox in JTable
    private void attachCheckBoxListeners()
    for(int row = 0; row< myJTable.getRowCount(); row++)
    Object val = cm.getValueAt(row, 0);
    final JCheckBox jcb = (JCheckBox) gridForms.getCellEditor(row, 0).getTableCellEditorComponent(gridForms, val, true, row, 0);
    jcb.addItemListener( new java.awt.event.ItemListener() // Add Item Listener to trap events
    public void itemStateChanged(java.awt.event.ItemEvent event)
                   if(myJtable.getSelectedRow() == -1) // if no row is selected in table return
                        return;
                   try               
                   if (res.absolute(myJtable.getSelectedRow())+1))
         if(jcb.isSelected())
    saveData();();      
         else
    deleteData();
         catch(Exception e)
    System.out.println("ERROR ");
    } //end of AttachCheckBoxListeners ()
    private void SaveData() {}
    private void DeleteData() {}
    Okay....the problem is when JCheckBox state is changed (by user) from Selected to Deselected itemStateChanged() is fired and it does delete from database. then again itemStateChanged() called it detects Jcheckbox as selected and does inseret in database. On Jtable gui...that checkbox is still shown as desected.
    Please tell me what is going on here.....
    Thank you.

    In short - never listen to low-level events from editorComponents (low-level meaning everything below - and most of the time including - a editingStopped/editingCancelled of the cellEditor). Your problem belongs to the model realm - save if a cell value is changed - so solve it in the model realm by listening to event from the tableModel and trigger your business logic when you detect a change in that particular cell value.
    Greetings
    Jeanette

  • Problem with JCheckBox in a JTable

    Hello,
    I have a JTable with JCheckBox as Editor for boolean values.
    I added a ListSelectionListener on that JTable.
    My problem is :
    when I click on a cell which have a JCheckBoxEditor, there is only one event generated : the one which unselect the row previously selected.
    So i can't answer the selection.
    what could have append ?
    thanks a lot.
    fleur.

    hi,
    I have no custom editor for this table.
    here is my code :
    public VDEComposant(Locale langue,InterfaceModeleur listener,Composant composant,int largeur) {
    super(langue,listener,largeur);
    this.setLayout(new BorderLayout());
    _modele=listener.getModele();
    _composantCourant=composant;
    this.addComposantsListener((ComposantsListener)listener.getGestionnaire());
    construitBarreOutils();
    setNbLigne1(this.listeComposant(composant).size());
    int m=0;
    if (composant==Composant.COMPOSANT){
    _donCompPereApTM=this.creeModeleDonnee1(composant);
    _donCompPereApTM.addTableModelListener(this);
    setTableau1(new JTable(_donCompPereApTM));
    m=1;
    else{
    if (composant.getPere()==Composant.COMPOSANT){
    _donCompApTM=creeModeleDonnee1(composant);
    _donCompApTM.addTableModelListener(this);
    setTableau1(new JTable(_donCompApTM));
    else {
    _donCompUtTM=creeModeleDonnee1(composant);
    _donCompUtTM.addTableModelListener(this);
    setTableau1(new JTable(_donCompUtTM));
    getTableau1().addMouseListener(((OngletDonnees)((OngletDonnees)getIHM().getOngletDonnees())).getOngletComposants());
    MultipleComboBoxCellEditor editor = new MultipleComboBoxCellEditor(new JComboBox());
    getTableau1().getColumnModel().getColumn(4+m).setCellEditor(editor) ;
    getTableau1().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    getTableau1().getSelectionModel().addListSelectionListener(this);
    Dimension d1 = new Dimension(_largeur, getNbLigne1()*16);
    JScrollPane sc1 = new JScrollPane(getTableau1());
    sc1.setViewportView(getTableau1());
    if((composant.getPere()!=null)&&(composant.getPere()!=Composant.COMPOSANT)){
    this.add(_outils,BorderLayout.NORTH);
    String s="";
    if((composant.getPere()==null)||(composant.getPere()==Composant.COMPOSANT)){
    String sc="";
    if(composant==Composant.COMPOSANT_IMAGE){
    sc=" "+_ressources.getString("images");
    if(composant==Composant.COMPOSANT_LINEAIRE){
    sc=" "+_ressources.getString("lineaires");
    if(composant==Composant.COMPOSANT_METAD){
    sc=" "+_ressources.getString("lotdonnees");
    if(composant==Composant.COMPOSANT_NGS){
    sc=" "+_ressources.getString("nongraphiques");
    if(composant==Composant.COMPOSANT_SURFACIQUE){
    sc=" "+_ressources.getString("surfaciques");
    if(composant==Composant.COMPOSANT_SYMBOLIQUE){
    sc=" "+_ressources.getString("symboliques");
    s=_ressources.getString("liste_composant")+sc;
    else{
    s=_ressources.getString("description_composant");
    JLabel lab = new JLabel(s,JLabel.CENTER);
    JPanel inter = new JPanel(new GridLayout(1,1));
    inter.add(lab);
    inter.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createRaisedBevelBorder(),BorderFactory.createEtchedBorder()));
    Box boite1 = Box.createVerticalBox();
    boite1.add(inter);
    boite1.add(sc1);
    _inter.add(boite1);
    //ajout du deuxieme tableau
    _donAttCompTM=this.creeModeleDonnee2(composant);
    _donAttCompTM.addTableModelListener(this);
    setTableau2(new JTable(_donAttCompTM));
    getTableau2().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    getTableau2().getSelectionModel().addListSelectionListener(this);
    getTableau2().addMouseListener(((OngletDonnees)((OngletDonnees)getIHM().getOngletDonnees())).getOngletComposants());
    //ComboBox pour saisir le type de l'attribut
    _typeA = new JComboBox();
    _typeA.addItem(TypeEtendu.DATE.getNom());
    _typeA.addItem(TypeEtendu.DOMAINE.getNom());
    _typeA.addItem(TypePrimitif.ENTIER.getNom());
    _typeA.addItem(TypePrimitif.LOGIQUE.getNom());
    _typeA.addItem(TypePrimitif.REEL.getNom());
    _typeA.addItem(TypePrimitif.TEXTE.getNom());
    (getTableau2().getColumnModel().getColumn(3)).setCellEditor(new DefaultCellEditor(_typeA));;
    //renderer pour la colonne des nom qui indique en gras l'attribut identifiant
    getTableau2().getColumnModel().getColumn(1).setCellRenderer(new AttributTableCellRenderer(_composantCourant));
    Dimension d2 = new Dimension(_largeur ,(getNbLigne2()*16));
    JScrollPane sc2 = new JScrollPane(getTableau2());
    sc2.setViewportView(getTableau2());
    _inter.createVerticalStrut(16);
    inter = new JPanel(new GridLayout(1,1));
    lab = new JLabel(_ressources.getString("attributs"),JLabel.CENTER);
    inter.add(lab);
    inter.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createRaisedBevelBorder(),BorderFactory.createEtchedBorder()));
    Box boite2=Box.createVerticalBox();
    boite2.add(inter);
    boite2.add(sc2);
    _inter.add(boite2);
    if((composant.getPere()!=null)&&(composant.getPere()!=Composant.COMPOSANT)){
    this.add(_inter,BorderLayout.CENTER);
    else{
    this.add(_inter,BorderLayout.NORTH);
    public void valueChanged(ListSelectionEvent e) {
    if (e.getValueIsAdjusting()) return;
    ListSelectionModel lsm =(ListSelectionModel)e.getSource();
    if (lsm.isSelectionEmpty()) {
    else {
    int ligneSel = lsm.getMinSelectionIndex();
    if(e.getSource()==getTableau2().getSelectionModel()){
    String alias = (String) _donAttCompTM.getValueAt(ligneSel,1);
    attribut = composantCourant.getAttribut(alias);
    else if(e.getSource()==getTableau1().getSelectionModel()){
    VectorTableModel vtm = null;
    int i = 0;
    if(_donCompApTM != null){
    vtm = _donCompApTM;
    if(_donCompPereApTM != null){
    vtm = _donCompPereApTM;
    i =1;
    if(vtm != null){
    String alias = (String) vtm.getValueAt(ligneSel,i);
    composantSelectionne= modele.getComposant(alias);
    else{
    composantSelectionne=composantCourant;
    I hope it make sens,
    thanks.

  • How to set cell background color for JCheckBox renderer in JTable?

    I need to display table one row with white color and another row with customized color.
    But Boolean column cannot set color background color.
    Here is my codes.
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.table.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.TreeSet;
    public class BooleanTable extends JFrame
        Object[][] data = {{Boolean.TRUE},{Boolean.TRUE},{Boolean.TRUE},{Boolean.TRUE},{Boolean.TRUE},{Boolean.TRUE}};
        String[] header = {"CheckBoxes"};
        public BooleanTable()
            setDefaultCloseOperation( EXIT_ON_CLOSE );
            TableModel model = new AbstractTableModel()
                public String getColumnName(int column)
                    return header[column].toString();
                public int getRowCount()
                    return data.length;
                public int getColumnCount()
                    return header.length;
                public Class getColumnClass(int columnIndex)
                    return( data[0][columnIndex].getClass() );
                public Object getValueAt(int row, int col)
                    return data[row][col];
                public boolean isCellEditable(int row, int column)
                    return true;
                public void setValueAt(Object value, int row, int col)
                    data[row][col] = value;
                    fireTableCellUpdated(row, col);
            JTable table = new JTable(model);
            table.setDefaultRenderer( Boolean.class, new MyCellRenderer() );
            getContentPane().add( new JScrollPane( table ) );
            pack();
            setLocationRelativeTo( null );
            setVisible( true );
        public static void main( String[] a )
            try
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            catch( Exception e )
            new BooleanTable();
        private class MyCellRenderer extends JCheckBox implements TableCellRenderer
            public MyCellRenderer()
                super();
                setHorizontalAlignment(SwingConstants.CENTER);
            public Component getTableCellRendererComponent(JTable
                                                           table, Object value, boolean isSelected, boolean
                                                           hasFocus, int row, int column)
                if (isSelected) {
                   setForeground(Color.white);
                   setBackground(Color.black);
                } else {
                   setForeground(Color.black);
                   if (row % 2 == 0) {
                      setBackground(Color.white);
                   } else {
                      setBackground(new Color(239, 245, 217));
                setSelected( Boolean.valueOf( value.toString() ).booleanValue() );
             return this;
    }

    Instead of extending JCheckBox, extend JPanel... put a checkbox in it. (border layout center).
    Or better yet, don't extend any gui component. This keeps things very clean. Don't extend a gui component unless you have no other choice.
    private class MyCellRenderer implements TableCellRenderer {
        private JPanel    _panel = null;
        private JCheckBox _checkBox = null;
        public MyCellRenderer() {
            //  Create & configure the gui components we need
            _panel = new JPanel( new BorderLayout() );
            _checkBox = new JCheckBox();
            _checkBox.setHorizontalAlignment( SwingConstants.CENTER );
            // Layout the gui
            _panel.add( _checkBox, BorderLayout.CENTER );
        public Component getTableCellRendererComponent(JTable table, Object value,
            boolean isSelected, boolean hasFocus, int row, int column) {
            if( isSelected ) {
               _checkBox.setForeground(Color.white);
               _panel.setBackground(Color.black);
            } else {
               _checkBox.setForeground(Color.black);
               if( row % 2 == 0 ) {
                  _panel.setBackground(Color.white);
               } else {
                  _panel.setBackground(new Color(239, 245, 217));
            _checkBox.setSelected( Boolean.valueOf( value.toString() ).booleanValue() );
            return _panel;
    }

  • How to change background color to JCheckBox in a JTable?

    Dear Friends,
    I have an JTable in my application. It has four columns. First, third and fourth column contains JCheckBox (JCheckBox is created using Boolean.class), secod column contains values.
    I have to change some of the cell color where JCheckBox is present.
    Could anyone please tell me how to change the color of the cell in the JTable?
    Thanks in advance,
    Sathish kumar D

    You would use a custom renderer.
    To get better help sooner, post a SSCCE that clearly demonstrates your problem.
    Use code tags to post codes -- [code]CODE[/code] will display asCODEOr click the CODE button and paste your code between the {code} tags that appear.
    db
    Alternative link: SSCCE
    Edited by: Darryl.Burke

  • How to Check and Uncheck the JCheckBox in the JTable?

    Dear Friends,
    I created a Table using JTable and it consists first column is JCheckBox (JCheckBox is included in JTable by using TableCellRenderer) and two more columns with Id and Name. How to enable the check and uncheck the JCheckBox in the Table and how to get the row id or values of the rows where the CheckBox is checked?
    Thanks in Advance.
    Sathish kumar D

    Read the API for JTable and follow the link to the tutorial on how to use tables, where you will find adequate guidance and examples.
    db
    edit And isn't this post on the same topic as your previous one? If so, please add a note that responses should be posted here and not on the other thread.
    [http://forums.sun.com/thread.jspa?threadID=5353422]
    Edited by: Darryl.Burke

  • How can I get the JCheckBox value in JTable?

    I have a JTable with JCheckBox inside. How can I get the value when the user turn on or off the check? I need to do this when the user change the value.
    Thanks for any help.
    Renato

    Hi again,
    no - the datamodel is a class that implements the TableModel-interface - if you do not use your own model in JTable, an instance of DefaultTableModel is used - you can subclass DefaultTableModel and overwrite its setValueAt(...)-method. When you instantiate your JTable do it by passing your DefaultTableModel subclass to the constructor or in the way you do it right now and replace the default model with your model using the setModel(...)-method of JTable.
    greetings Marsian

  • JCheckBox inside a JTable

    hai,
    i was trying to insert a JCheckBox for one column of the JTable. actually its getting inserted but its not visible. whenever the table is shown, only the value of the check box is visible on that cell, but not the checkbox. only if i click on that corresponding cell, as long as the mouse is pressed, i can view the chk box, but normally only the value is visible.
    can anyone please help me in viewing the check box. please do help i'm breaking my head without knowing the reason for this.
    Thanx u in advance.
    regards,
    Fazlina

    hai,
    thanx for ur quick reply. it does work fine. but now i'm not able to either chk it or unchk it.
    here is my code.can u please help me.
    import javax.swing.*;
    import javax.swing.table.*;
    import javax.swing.border.*;
    import java.awt.Dimension;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    public class TableExample {
    public TableExample() {
    JFrame frame = new JFrame("Table");
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {System.exit(0);}});
    final String[] names={"FirstCol","SecondCol"};
    final Object[][] data={                                   {"Black",new Boolean(true)},                              {"White",new Boolean(true)}                         };
              // Create a model of the data.
         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 Class getColumnClass(int col)
                   if (col == 1) return Boolean.class;
                   return super.getColumnClass(col);
    // Create the table
    JTable tableView = new JTable(dataModel);
    tableView.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    // Finish setting up the table.
    JScrollPane scrollpane = new JScrollPane(tableView);
         scrollpane.setBorder(new BevelBorder(BevelBorder.LOWERED));
    scrollpane.setPreferredSize(new Dimension(430, 200));
    frame.getContentPane().add(scrollpane);
    frame.pack();
    frame.setVisible(true);
    public static void main(String[] args) {
    new TableExample();
    i donno where i made the mistake can u please help me out as early as possible.
    thanx in advance.
    Regards,
    Fazlina

  • How to put jcheckbox in a jtable

    The problem is as followed:
    I've got An MSAcces2000 Database. From in my java prog I am getting data from this dbase. the data is loaded into a resultset. This resultset is loaded in a jtable.
    Now i want two extra columns in the jtable. One with a jcheckbox and one with a counter. So How do i do that...
    Anyone an idea

    thanks, but with the counter I mean: a counter that can be set to a certain number. That number represents how many times the line in printed. the checkbox represent if the line is printed at all...
    Somebody has an example of a cell renderer, because I don't get much of the tutorial. I can get checkboxes when i add a column in my dbase with boolean. But i don't wonna do it that way. My program has to fenerate an extra column iwth checkboxes and an counter....

  • Checking Unchecking of JCheckBox value  inside JTable cell

    My problem is that i have jtable which has table data. In that first column has jcheckbox values which are there because of the tabledata has firstcolumn values as boolean, to know the no of checks in jcheckboxes in jtable, there is count variable which needs to be dynamic. When i first check the box the variable that i have set to know the check i.e count increases by one, then next jcheckbox if i check then count goes to 2, but real problem is when i do some 2 events on same checkbox then ie. if i check the jcheckbox , the count increases but after that the jcheckbox doesnot listen to events fired. Any help is appreciated

    The example from above shows how to add Objects to a table. If you want a column of checkBoxes then simply replace the Objects in one of the columns with:
    new Boolean(false)
    Read the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/table.html]How to Use Tables for more information.

  • About row selection in JTable

    This is also a question about JTable, when type the key "ENTER", the row selection will focus on the next line, how can I stop this default action? Can I make the default action of pressing "ENTER" to be activate a cell in the JTable to editing state?
    Thanks for any help.

    Sorry, I need to ask for help again, yes, in your case, the method works,
    but I am afraid this method does not help me, because I don't know HOW TO MAKE THE F2 FUNCTION in my case.
    I use the method you recommend, and yes I can stop the default response of pressing ENTER, it means when I stroke ENTER in my table, the selection won't go to the next line, but it just up to my half purpose, how can I use Enter to editing a cell then? My silly question is I even don't know how to make F2 works?

  • Problem in Adding JCheckBox Object to JTable

    I want to add a JCheckBox Object to A JTbale Coloumn but it shows the following message in JTable Coloumn-
    javax.swing.JCheckBox[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.5,border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@f9f9d8,flags=296,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=2,bottom=2,right=2],paintBorder=false,paintFocus=true,pressedIcon=,rolloverEnabled=true,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=].
    Help Me in solving this problem

    Hi,
    All the thing you have to do is to return a boolean for the column. JTable will use a checkbox (as default) to show boolean values.

  • Question about GUI Design on JTable and its separate editor

    Hi all,
    I need to use JTable with separate editor , that way when I double click one of the JTable's row its editor will popup in another window.
    Based on GUI design principles, where should I put the editor, in another tab panel or a JDialog ?
    Any advice would be greatly appreciated.
    Regards,
    Setya

    if you dont have to edit a lot of fields, this will
    be a good solution.
    but if you have many fields, it would be a good thing
    to put a JTabbedPane into the under
    JSplitPane-container ... or to use a JDialog :)Yes, that's the only problem I can think of, if the fields are too many.
    But then, if I have so many fields in one form. I won't put them in a JTable because users will find it cumbersome for having to scroll left and right to see those fields. I believe on this scenario JTable is just not the right component to use.
    Regards,
    Setya

  • About focu in a JTable

    Hi,
    Is it possible to make a column of a JTable not focusable ? How?
    Thanks
    Stephen

    Hi,
    int colIndx = jTable2.getColumnModel().getColumnIndex("LastName");
    jTable2.getColumnModel().getColumn(colIndx).setCellRenderer(new MyTableCellRenderer());
    class MyTableCellRenderer implements TableCellRenderer{
    public Component getTableCellRendererComponent(JTable table,
    Object value,
    boolean isSelected,
    boolean hasFocus,
    int row, int column) {
    JTextPane colRenderer = new JTextPane();
    colRenderer.setText((String)value);
    colRenderer.setFocusable(false);
    return colRenderer ;
    Frank

Maybe you are looking for

  • How do I make a typography image in illustrator?

    How do I make an image like the one below in illustrator? I want to do this with my logo and small font. I am new to illustrator but i am okay with the basics.  Thank you for your time.

  • Help Zeroing Out Data On eMac

    I'm trying to wipe out the hard drive on my folks' old eMac.  I'm going to recycle the computer but it is important that I at least zero out the data and not just erase it superficially. The disk that came with the mac is 10.1.4, so I gues it doesn't

  • Browser problems - websites do not load properly

    Here is a screen-shot: http://imgur.com/Qkvnr I am using a mac desktop; version 10.6.8. For the past few months, I have been having browser issues with EVERY SINGLE possible browser out there. I cannot load simple pages like facebook or hotmail, rath

  • Photoshop Elements 10, Organizer funktioniert nicht mehr

    Beim Einschalten von Adobe Photoshop Elements 10, Organizer erscheint ein Fenster mit dem Hinweis " Elements 10 Organizer funktioniert nicht mehr, es wird nach einer Lösung für das Problem gesucht". Darauf folgt: "Das Programm wird auf Grund eines Pr

  • Migrating email-enabled public folders corrupted

    We migrated our public folders from EX 2010 to 2013 but currently face 2 issues with the import: a.  All public folders/subfolders became email disabled - about 300 + folders b. More importantly there is a mismatch between folder name and assigned sm