Window Builder Pro hangs in Eclipse Luna on Ubuntu 14.04 LTS

If you use Eclipse IDE for Java development, you will find that there is a great GUI builder from Google, and it worked very well on previous releases of Ubuntu. Unfortunately, Eclipse just freezes when you use Windows Builder on 64 bit Ubuntu 14.04 LTS. Several posts on the Internet suggest installing Oracle Java 7 … Continue reading Window Builder Pro hangs in Eclipse Luna on Ubuntu 14.04 LTS

Read data from a JTable created from AbstractTableModel

If you have a JTable in Java created with an AbstractTableModel, you can read the data from it, using following: int rowCount = testTable.getRowCount(); for (int i = 0; i < rowCount; i++) { String mColumn1 = (String) testTable.getModel().getValueAt(i, 0); String mColumn2 = (String) testTable.getModel().getValueAt(i, 1); } Alternatively, you could also try where the JTable … Continue reading Read data from a JTable created from AbstractTableModel

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() … Continue reading Delete a selected row in JTable with a custom model

Java program bug due to multiple declaration of variable in code and the fix

I created a small Java class to accept a date. However, when I tried to use it, I got a NullPointerException error. This post is just to illustrate how it was fixed. 1 public class DateForm { 2 JFormattedTextField txtMyDate;     //This is a variable at class level 3 4 dateForm () { 5 JTextFormattedField … Continue reading Java program bug due to multiple declaration of variable in code and the fix

How to restrict size of JButton in GridLayout in Java

If you put the following code in Java with only the lines in blue in your Java Swing program, you will find that whenever the Java dialog is resized, the button grows and looks ugly as it occupies the full row of the GridLayout. Code Segment as below. parameterPanel.setLayout(new GridLayout(2,1)); JButton parameterButton = new JButton("Parameters"); … Continue reading How to restrict size of JButton in GridLayout in Java

How to create a new stock quote source for Gnucash using Finance::Quote

Note that I no longer use github. This post is for technical users. The objective is to share how the MumbaiStock.pm module was created. Visit this other post to know how to add the MumbaiStock.pm to Gnucash and use it. Problem: A friend of mine uses Gnucash to manage their personal finances. They configured and … Continue reading How to create a new stock quote source for Gnucash using Finance::Quote

Database Design Utilities in Linux

If you are into designing databases, you can use the following open source database design software. I had a problem wherein it became quite difficult to manage a database with lots of tables and relationships, and these kind of software made database design much simpler. easyDesigner http://sourceforge.net/projects/easydesigner/ project Mogwai http://mogwai.sourceforge.net/index.html http://mogwai.sourceforge.net/erdesignerng.html DBDesigner4 http://www.fabforce.net/dbdesigner4/ Database Deployment … Continue reading Database Design Utilities in Linux

Write Ahead Logging in SQLite 3.7.0 version and above

So far, SQLite did support transaction control, but entirely in memory. Version 3.7.0+ of SQLite now have a Write-Ahead Logging feature that allow more speed and flexibility to SQLite to manage record locking and journal management. This feature is called 'wal' in SQLite 3.7.0+. To activate WAL on a SQLite database, start up SQLite and … Continue reading Write Ahead Logging in SQLite 3.7.0 version and above