public void addEvents () {
		addRandButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				// EVENT FOR THE ADD BUTTON
				int value = (int) (Math.random()*100+1);

				addProceed(value);
			}
		});

		addButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				// EVENT FOR THE ADD Value BUTTON
//				string 
				
				int value; 
				
				try {
					value = Integer.parseInt(valueField.getText());
				} catch (NumberFormatException e) {
					System.out.println("not a number");
					logField.setText("'" + valueField.getText() + "' is not a number");
					return;
				}
				
				if (value > 999 || value < -99) {
					System.out.println("to many symbols");
					logField.setText("proposed rage: from -99 to 999");
					return;
				}
				
				addProceed(value);

			}
		});
		
		searchButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				int value;
				
				try {
					value = Integer.parseInt(valueField.getText());
				} catch (NumberFormatException e) {
					System.out.println("not a number");
					logField.setText("'" + valueField.getText() + "' is not a number");
					return;
				}
				
				Tree result = treeLogic.searchNode(value);
				if (result == null) {
					logField.setText("node " + value + " is not exist");
				} else {
					logField.setText("node " + value + " is found");
				}
				treePanel.repaint();
			}
		});
		
		removeButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				int value;
				
				try {
					value = Integer.parseInt(valueField.getText());
				} catch (NumberFormatException e) {
					System.out.println("not a number");
					return;
				}
				
				
				TreeLogic.setAdded(-1000);
				TreeLogic.setRemoved(value);
				
				Tree forRemove = treeLogic.searchNode(value);
				if (forRemove == null) {
					logField.setText("node " + value + " is not exist");
					return;
				}
				
				TreeLogic.setRemoved(value);
				treePanel.repaint();
				
				enableComponents(buttonPanel, false);
				new java.util.Timer().schedule( 
			        new java.util.TimerTask() {
			            @Override
			            public void run() {
			            	treeLogic.removeNode(forRemove);
							treePanel.repaint();
							enableComponents(buttonPanel, true);
							logField.setText("node " + value + " removed");
			                // your code here
			            }
			        }, 
			        2000 
				);				
				
				
				
			}
		});
		
		clearButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
//				System.out.println("CLEAR");
				treeLogic.clearTree();
				treePanel.repaint();
				logField.setText("cleared");
			}
		});


	}