@SuppressWarnings("unchecked")
	private void getDebateList() {
		debateList = debate.getDebateList();
		topicDBDLM.removeAllElements();
		numberTurnDBDLM.removeAllElements();
		statusDBDLM.removeAllElements();
		winnerDBDLM.removeAllElements();
		int activeTopic = 0, completedTopic = 0, pendingTopic = 0;
		for (int i = 0; i < debateList.size(); i++) {
			topicDBDLM.addElement(debateList.get(i).getTopic());
			numberTurnDBDLM.addElement(debateList.get(i).getTurnDuration());
			statusDBDLM.addElement(debateList.get(i).getStatus());
			if (debateList.get(i).getWinner() == 0 ) {
				winnerDBDLM.addElement("Team: A");
			} else if (debateList.get(i).getWinner() == 1) {
				winnerDBDLM.addElement("Team: B");
			} else {
				winnerDBDLM.addElement("---");
			}
			
			// Check debate status
			if (debateList.get(i).getStatus().equals("Compeleted")) {
				completedTopic++;
			} else if (debateList.get(i).getStatus().equals("Active")) {
				activeTopic++;
			} else if (debateList.get(i).getStatus().equals("Pending")) {
				String fileName = "src/xml/Debate" +  debateList.get(i).getId() + "/PublicDialog.xml";
				PublicDialogDao publicDialogDao = new PublicDialogDao(fileName);
				if (publicDialogDao.getPublicDialogList().size() != 0) {
					DebateDao debateDao = new DebateDao();
					Debate debate = debateList.get(i);
					debate.setStatus("Active");
					if (debateDao.editDebate(debate)) {
						activeTopic++;
					} else {
						pendingTopic++;
					}
				} else {
					pendingTopic++;
				}
				
				
			}
			titleDBJlbl.setText("Total Debates: " + (completedTopic + activeTopic)
						+ " | Active: " + activeTopic
						+ " | Pending: " + pendingTopic
						+ "| Completed: " + completedTopic);
		}
		
		if (debateList.size() == 0) {
			titleDBJlbl.setText("Total Debates: 0 | Active Debates: 0 | Completed Debates: 0");
		}
		
	}