Delete a selected row in JTable with a custom model

DefaultTableModel model = (DefaultTableModel) myTable.getModel(); //Get reference to model model.removeRow(x); //Remove row x

You can also add a method deleteRow(int row) to your custom model class code as in:

public class MyTableModel extends AbstractModel { private Vector dataVector = new Vector(); String[] columnNames = {“First Name”, “Last Name”, “Age”}; public int getRowCount() { if (dataVector.size() . . . → Read More: Delete a selected row in JTable with a custom model

Delete all rows from a Java JTable with a custom TableModel

I want to clear all rows in a custom TableModel. Unfortunately, a custom TableModel in Java does not allow use of most efficient of row clearing methods, which only applies to a DefaultTableModel like that shown below: myTableModel.getDataVector().removeAllElements(); myTableModel.fireTableDataChanged(); To do an all clear like the above, for a custom TableModel, you need to reset . . . → Read More: Delete all rows from a Java JTable with a custom TableModel

Very good example of Swing and JDBC code in Java

If you are new to Java Programming and need to understand clearly how Swing GUIs and JDBC work together for GUI and databases, you should have a look at http://www.javabeginner.com/java-swing/java-swing-address-book. One of the best examples available on the net to understand database programming.

UML Diagrammer / Class Generator Tool on Linux

Astah Community Edition

Today’s object oriented languages require extensive use of objects, their inter-relationships and methods. There are several UML tools out there like UMlet, Umbrello on Linux, but this one from astah stands out. You can try the community edition before deciding to purchase a full version. It enables the creation of objects, building . . . → Read More: UML Diagrammer / Class Generator Tool on Linux

Head First Java – Learn Java the fun way

After many years of trying to learn Java from a good book, I finally got down to learning it from “Head First Java”. The authors have done a great job explaining programming concepts, object oriented programming concepts and Java in a fun way. All the investments made thus far, in other books were just that… . . . → Read More: Head First Java – Learn Java the fun way

October 2019
M T W T F S S
« Sep    
 123456
78910111213
14151617181920
21222324252627
28293031