public WorldTimeConverter() {
//		lbStatus = new JLabel("time converter");
		calendar = Calendar.getInstance();
		timeZones = TimeZone.getAvailableIDs();
		Arrays.sort(timeZones);
		tz = calendar.getTimeZone();
		setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));
		setLayout(new GridLayout(4, 3, 0, 0));
		add(lbStatus);
		
		JLabel lblTimeZone = new JLabel("TimeZone");
		lblTimeZone.setFont(new Font("Dialog", Font.PLAIN, 17));
		add(lblTimeZone);
		
		JLabel lblTime = new JLabel("Time");
		lblTime.setFont(new Font("Dialog", Font.PLAIN, 17));
		add(lblTime);
		
		JLabel lblFrom = new JLabel("From: ");
		lblFrom.setFont(new Font("Dialog", Font.ITALIC, 17));
		add(lblFrom);
		
		comboBoxFromTimeZone = new JComboBox();
		comboBoxFromTimeZone.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				if (comboBoxFromTimeZone != null && comboBoxFromTimeZone.getSelectedIndex() != -1 && comboBoxToTimeZone != null && comboBoxToTimeZone.getSelectedIndex() != -1){
				btnSwap.setEnabled(true);
				btnConfirm.setEnabled(true);
				}
			}
		});
		comboBoxFromTimeZone.setEditable(true);
		comboBoxFromTimeZone.setMaximumRowCount(15);
		comboBoxFromTimeZone.setFont(new Font("Dialog", Font.ITALIC, 12));
		comboBoxFromTimeZone.setModel(new DefaultComboBoxModel(timeZones));
		comboBoxFromTimeZone.setSelectedIndex(findIndexOfATimeZone(TimeZone.getDefault().getDisplayName(true, 0)));
		//System.out.println(TimeZone.getDefault().getDisplayName(true, 0));
		add(comboBoxFromTimeZone);
		
		textFieldFromTime = new JTextField();
//		textFieldFromTime.setText((new SimpleDateFormat("HH:mm:ss")).format(calender.getTime()));
		textFieldFromTime.setText((formatter.format(calendar.getTime())));
		add(textFieldFromTime);
		textFieldFromTime.setColumns(10);
		
		JLabel lblNewLabel = new JLabel("New label");
		lblNewLabel.setFont(new Font("Dialog", Font.ITALIC, 17));
		add(lblNewLabel);
		
		comboBoxToTimeZone = new JComboBox();
		comboBoxToTimeZone.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				if (comboBoxFromTimeZone != null && comboBoxFromTimeZone.getSelectedIndex() != -1 && comboBoxToTimeZone != null && comboBoxToTimeZone.getSelectedIndex() != -1){
				btnSwap.setEnabled(true);
				btnConfirm.setEnabled(true);
				}
			}
		});
//		comboBoxToTimeZone.addActionListener(new ActionListener() {
//			public void actionPerformed(ActionEvent e) {
//				if (comboBoxToTimeZone.getSelectedIndex() != -1){
//					btnConfirm.setEnabled(false);
//				}
//			}
//		});
		comboBoxToTimeZone.setEditable(true);
		comboBoxToTimeZone.setMaximumRowCount(15);
		comboBoxToTimeZone.setFont(new Font("Dialog", Font.ITALIC, 12));
		comboBoxToTimeZone.setModel(new DefaultComboBoxModel(timeZones));
		comboBoxToTimeZone.setSelectedIndex(-1);
		add(comboBoxToTimeZone);
		
		textFieldToTime = new JTextField();
		textFieldToTime.setEditable(false);
		add(textFieldToTime);
		textFieldToTime.setColumns(10);
		
		btnBack = new JButton("Back");
		btnBack.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				MainFrame.cardLayout.show(getParent(), "startScreen");
			}
		});
		add(btnBack);
		
		btnSwap = new JButton("Swap");
//		btnSwap.setEnabled(false);
//		if (comboBoxFromTimeZone.getSelectedIndex() != -1 && comboBoxToTimeZone.getSelectedIndex() != -1){
//			btnSwap.setEnabled(true);
//		}
		btnSwap.setEnabled(true);
		//System.out.println(comboBoxFromTimeZone.getSelectedIndex());
		btnSwap.addActionListener(/*new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				
			}
		}*/ this);
		add(btnSwap);
		
		btnConfirm = new JButton("Confirm");
		btnConfirm.addActionListener(/*new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				int comboBoxToTimeZone1, comboBoxFromTimeZone;
				//comboBoxToTimeZone1 = comboBoxToTimeZone.getSelectedIndex();
			}
		}*/this);
		btnConfirm.setEnabled(false);
		add(btnConfirm);
		setFocusTraversalPolicy(new FocusTraversalOnArray(new Component[]{comboBoxFromTimeZone, textFieldFromTime, comboBoxToTimeZone, textFieldToTime, btnBack, btnSwap}));

	}