Analytics Vidhya
Published in

Analytics Vidhya

Simplistic Mental Health Solution

Mental health has been one of several issues for many who identify as any demographical type.

Here is a computerized version for technologically savvy individuals who may suffer from a health issue associated with mental health.

Binding Disclaimer:

This application is not a substitute for healthcare or medical help, although it may be sufficient for individuals who may feel comfortable with a temporary time-consuming alternate option.

Goal: Minimize mental health issues with a temporary alternative. By counting a prominent emotion or feeling, further help accordingly. Although this alternate solution may not appear fun and addictive to promote mental health solutions, we can use the concept of finding mode as a baseline to include additional technological advancements such as ambiance or other user-friendly interface interactions. I base the application on a mouse click with either a point-and-click concept or a direct physical press concept.

Prerequisites:

  • NetBeans 8.2.
  • Basic knowledge of Java and general coding.

I wrote the code below in Java.

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package buttoncounter;
import java.text.SimpleDateFormat;
import static javafx.application.Application.launch;
import java.time.LocalDateTime;
import java.util.Calendar;
import java.util.Date;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.scene.text.Text;
import javafx.stage.Stage;
/**
*
* @author pkaly
*/
public class ButtonCounter extends Application {
/**
* @param primaryStage
*/
@Override
public void start(Stage primaryStage) {
StackPane root = new StackPane();
Scene scene = new Scene(root, 300, 250);
Text titlet = new Text();
titlet.setText("Decide");
Button btn = new Button();
Button btn2 = new Button();
Button btn3 = new Button();
btn.setText("Emotion/Feeling [1]");
btn2.setText("Emotion/Feeling [2]");
btn3.setText("Emotion/Feeling [3]");
btn.setOnAction(new EventHandler<ActionEvent>() {
int count = 0;


@Override
public void handle(ActionEvent event) {
//System.out.println(txtb.getCharacters());
count++;
LocalDateTime timestamp = LocalDateTime.now();
Date currentTime = Calendar.getInstance().getTime();
SimpleDateFormat dateFormat = new SimpleDateFormat("hh.mm.ss aa");
String output = dateFormat.format(currentTime);
System.out.println( btn.getText() + " has been pressed: " + count + " time(s) on " + timestamp + " at " + output);
}
});btn2.setOnAction(new EventHandler<ActionEvent>() {
int count2 = 0;
@Override
public void handle(ActionEvent event) {
//System.out.println(txtb.getCharacters());
count2++;
LocalDateTime timestamp = LocalDateTime.now();
Date currentTime = Calendar.getInstance().getTime();
SimpleDateFormat dateFormat = new SimpleDateFormat("hh.mm.ss aa");
String output = dateFormat.format(currentTime);
System.out.println(btn2.getText() + " has been pressed: " + count2 + " time(s) on " + timestamp + " at " + output);
}



});

btn3.setOnAction(new EventHandler<ActionEvent>() {
int count3 = 0;
@Override
public void handle(ActionEvent event) {
//System.out.println(txtb.getCharacters());
count3++;
LocalDateTime timestamp = LocalDateTime.now();
Date currentTime = Calendar.getInstance().getTime();
SimpleDateFormat dateFormat = new SimpleDateFormat("hh.mm.ss aa");
String output = dateFormat.format(currentTime);
System.out.println(btn3.getText() + " has been pressed: " + count3 + " time(s) on " + timestamp + " at " + output);
}



});
StackPane.setAlignment(btn, Pos.TOP_CENTER);
StackPane.setAlignment(btn2, Pos.CENTER);
StackPane.setAlignment(btn3, Pos.BOTTOM_CENTER);
primaryStage.setTitle("PushIt");
root.getChildren().addAll(titlet,btn,btn2,btn3);
primaryStage.setScene(scene);
primaryStage.show();


}
public static void main(String[] args) {
// TODO code application logic here

launch(args);
}

}

Written within the code, a comment associated with each button. Each button represents an emotion or thought that comes up — either intentionally or unintentionally, can become renamed.

Shown above is a visual of how the application may appear. Pressing any button triggers text. Since a counter is built in the code, the need to keep track of recurring thoughts is unnecessary, as moving forward does not have to include counting unwelcomed past thoughts.

Conclusion:

At the beginning of the article, a binding disclaimer is present. Here is a reminder:

Binding Disclaimer:

This application is not a substitute for healthcare or medical help, although it might become sufficient for individuals who may feel comfortable with a temporary time-consuming alternate option.

It was once said,

The hand is quicker than the eye.

— Dave Williamson.

Everyone has their own preferences, and traditional mental health care providers and supplemental options may not provide the means for unique individual needs. Digitalized versions of face-to-face verbal communication for personality characteristic traits are possibly the only solutions to some hidden and unkept health anomalies.

Takeaways:

  • Java remains relevant.
  • Mental health hygiene is also important.
  • Providing alternative mental health solutions can become beneficial.

--

--

--

Analytics Vidhya is a community of Analytics and Data Science professionals. We are building the next-gen data science ecosystem https://www.analyticsvidhya.com

Recommended from Medium

Serverless website using AWS S3, APIGateway, Lambda in Nodejs & DynamoDB

Digital image processing using Matlab on Altera FPGA

Dart Apprentice — Part II

A Guild to Beautiful Games

Developer Diaries E06

Singleton design pattern in game development for creating managers — Part 1

Flutter Design Patterns: 11 — Abstract Factory

Using VBA and Excel to Make Authenticated Requests for Alpaca’s Trading API

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Priya Kalyanakrishnan

Priya Kalyanakrishnan

End-to-end tech articles. End-user tech support. Updating / Upgrading tech skills.

More from Medium

Developing CTC loss for Tensorflow.JS

Spark AR Updates…

Data Analytics Preparation and Visualization on Poverty Population in West Java

Poverty’s in West Java Area

Hello friends!