Java Basic Problems

Java JButton below the JTable: How to use and place JButton just under or beneath the JTable.

JBUtton below the JTableHere I am sharing with you another simple but important  fact related to  java JTable and JButton. If you are using JButton and JTable in your software, it may need to place your JButton just under or below the JTable. Here I have shown the way how to place JButton just beneath the JTable. Just copy the code below and run in your pc.

Here is the Code:   JButton Just Below or beneath the JTable

Continue reading “Java JButton below the JTable: How to use and place JButton just under or beneath the JTable.”

Java Basic Problems

Java JTable Cell and JTextField: How to use and assign JTextField in JTable cell.

I think, to assign a JTextField in JTable cells is really important for the purpose of JTable cell validation. For many purpose in software development where we use JTable may need to use JTable cell validation  and for this validation purpose we may also need to assign and use JTextField in JTable cell. In the given Example, I have assigned and used  a JTextField  in the  Column 2  of the following JTable. Just Copy the code and Run it in your computer.

Continue reading “Java JTable Cell and JTextField: How to use and assign JTextField in JTable cell.”

Java Basic Problems

Java: Collect JTable value to Vector

Sometimes in Java programming we may need to collect the value in the JTable to a Vector

Here is a portion of the java  code  which   is used to  collect JTable value to Vector.                                                  

                                                    

Code Example:

                                                     try

                                                  {

                                                            Vector data=new Vector(); // import java.util.Vector;                           

                                                            for(int i=0;i<jtable_config.getRowCount();i++)

                                                            {                     

                                                                        data.add(jtable_config.getValueAt(i,0));

                                                                        data.add(jtable_config.getValueAt(i,1));

                                                                        System.out.println(“id”+data);

                                                                        System.out.println(“name”+temp.VALUE);

                                                            }

                                                           }

                                               catch (RemoteException e1)

                                                   {      

                                                   e1.printStackTrace();

                                                   }