@Override
	public void actionPerformed(ActionEvent e) {
		enableApply.setEnabled(false);
		disableApply.setEnabled(false);
		button.setEnabled(false);
		if(e.getSource().equals(enableApply)) {
			new Thread(new Runnable() {
				
				@Override
				public void run() {
					try {
						AdminClient.client.enableGPS();
						JOptionPane.showMessageDialog(SetupGPS.this, "The GPS has been successfully enabled.");
					} catch(IllegalAccessError e) {
						JOptionPane.showMessageDialog(SetupGPS.this, "Selected GPS is already enabled.", "Error", JOptionPane.ERROR_MESSAGE);
					} catch (SocketTimeoutException e) {
						JOptionPane.showMessageDialog(SetupGPS.this, "The connection is down.", "Error", JOptionPane.ERROR_MESSAGE);
						
						Authentication authentication = new Authentication(parent);
						authentication.setLocation(SetupGPS.this.getX() - SetupGPS.this.getWidth(), SetupGPS.this.getY());
						parent.getContentPane().add(authentication, 0);
						Utilities.transitionEffect(SetupGPS.this, authentication, parent, true);
						SwitchServerWindow s = new SwitchServerWindow();
						s.requestFocus();
					}
					enableApply.setEnabled(true);
					disableApply.setEnabled(true);
					button.setEnabled(true);
				}
			}).start();
		}else if(e.getSource().equals(disableApply)) {
			new Thread(new Runnable() {
				
				@Override
				public void run() {
					try {
						AdminClient.client.disableGPS();
						JOptionPane.showMessageDialog(SetupGPS.this, "The GPS has been successfully disabled.");
					} catch(IllegalAccessError e) {
						JOptionPane.showMessageDialog(SetupGPS.this, "Selected GPS is already disabled.", "Error", JOptionPane.ERROR_MESSAGE);
					} catch (SocketTimeoutException e) {
						JOptionPane.showMessageDialog(SetupGPS.this, "The connection is down.", "Error", JOptionPane.ERROR_MESSAGE);
						
						Authentication authentication = new Authentication(parent);
						authentication.setLocation(SetupGPS.this.getX() - SetupGPS.this.getWidth(), SetupGPS.this.getY());
						parent.getContentPane().add(authentication, 0);
						Utilities.transitionEffect(SetupGPS.this, authentication, parent, true);
						SwitchServerWindow s = new SwitchServerWindow();
						s.requestFocus();
					}
					enableApply.setEnabled(true);
					disableApply.setEnabled(true);
					button.setEnabled(true);
				}
			}).start();
		} else if(e.getSource().equals(button)) {
			Menu m = new Menu(parent, "resources/Menu.png");
			m.setLocation(SetupGPS.this.getX() - SetupGPS.this.getWidth(), SetupGPS.this.getY());
			parent.getContentPane().add(m, 0);
			Utilities.transitionEffect(SetupGPS.this, m, parent, true);
		}
	}