Hi, please help.
i'm having problem in my code, that a number display in E7 example 10.000.000 it display as 1E7.
here is my code:
private void GridListing() {
try {
statement = DBConnections.getDBConnectionSys().createStatement ();
if (jSearchBy1.getSelectedItem() == "Kode Jurnal")
Criteria = " WHERE journal_no Like '" + jTxtSearch1.getText() + "%'";
else if (jSearchBy1.getSelectedItem() == "Tanggal Jurnal")
Criteria = " WHERE journal_date '" + jTxtSearch1.getText() + "%'";
//Different DB Different Terms of Syntax
if (GlobalSettings.dataBaseType == 1 || GlobalSettings.dataBaseType == 2) {
Query = ("SELECT TOP 100 * FROM " + Table + Criteria); }
if (GlobalSettings.dataBaseType == 3 || GlobalSettings.dataBaseType == 4) {
Query = ("SELECT * FROM " + Table + Criteria );
}
result = statement.executeQuery(Query);
int Numrow = 0;
int Numrow1 = 0;
int MaxProgress = 100;
//
ResultSet rs= statement.getResultSet();
ResultSetMetaData md = rs.getMetaData();
int columnCount = md.getColumnCount();
Vector data = new Vector(columnCount);
Vector row = new Vector(columnCount);
Vector columnNames = new Vector(columnCount);
for (int i = 1; i <= columnCount; i++) {
columnNames.addElement( md.getColumnName(i));
}
while (rs.next()) {
for (int i = 1; i <= columnCount; i++) {
row.addElement(rs.getObject(i));
}
data.addElement(row);
row = new Vector(columnCount); // Create a new row Vector
Numrow++;
}
DefaultTableModel model = new DefaultTableModel(data, columnNames);
jTable1.setModel( model );
jTable1.setSelectionMode(ListSelectionModel.SINGLE _SELECTION);
jTable1.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
jTable1.setDefaultEditor(Object.class, null);
String header[] = {"Kode Jurnal"};
for(int i=0;i<jTable1.getColumnCount();i++)
{
TableColumn column1 = jTable1.getTableHeader().getColumnModel().getColum n(i);
column1.setHeaderValue(header[i]);
column1.setPreferredWidth(100);
}
} catch (SQLException sqlex) {
jLblStatementError.setText(sqlex.toString());
}
}