private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
		String url = "jdbc:mysql://db4free.net:3306/";
		String driver = "com.mysql.jdbc.Driver";
		String userName = "komunikator";
		String password = "pawel01";
		String login1 = "";
		String password1 = "";
		String loginTB = jTextField1.getText();
		String passwordTB = jTextField2.getText();
		ResultSet resultSet = null;
		Statement statement = null;
		boolean authentication = false;

		try {
			
			Class.forName(driver).newInstance();
			Connection conn = DriverManager.getConnection(url, userName,
					password);
			jLabel1.setText("Connected");
			statement = conn.createStatement();
			resultSet = statement
					.executeQuery("select * from komunikatorpsz.User");
			while (resultSet.next()) {
				login1 = resultSet.getString("Login");

				password1 = resultSet.getString("Password");

				if (login1.equals(loginTB))
					if (password1.equals(passwordTB)) {
						authentication = true;
						break;
					} else
						authentication = false;

			}
			if (authentication)
			{
				jLabel1.setText("Logged In");
				this.show(false);
				mainwindow main = new mainwindow(loginTB);
				main.show(true);
			}
			else
				jLabel1.setText("Wrong Login or Password");

			conn.close();
		} catch (Exception e) {
			jLabel1.setText("Not Connected");
			e.printStackTrace();
		}

		// TODO add your handling code here:
	}