private void refreshTable() throws NullPointerException {
		String[] columnNames = new String[] { "Id", "Name", "Quantity",
				"Price", "Description" };
		Object[][] temp = Main.getTableData();
		DefaultTableModel tableModel = new DefaultTableModel(
				temp, columnNames);
		summa=Main.getTotal();
		sum.setText(summa.toString());
		if (table == null)
			table = new JTable(tableModel);
		else
			table.setModel(tableModel);
	}