I am struggling with getting variables (all kinds: arrays, Strings, int) from a method (the method where I create the my GUI fields) into another method (the method where i manage my keypress events) I managed to get the fields, via their names, but I don't know how to get some variables.
Example: In the Field Method i got this part: I manage My timestuff and put it into the input field(s) (rest is cut out)
DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
Calendar today = Calendar.getInstance();
today.clear(Calendar.HOUR); today.clear(Calendar.MINUTE); today.clear(Calendar.SECOND);
Date todayDate = today.getTime();
long todayDateUnix = Instant.now().getEpochSecond();;
String reportDate = df.format(todayDate);
String CustomDate = "meinDatum";
String[] parts = reportDate.split("/");
String DateDay = parts[0];
String DateMonth = parts[1];
String DateYear = parts[2];
JTextField input_day =new JTextField(DateDay);
// input_day.setFocusTraversalKeysEnabled(false);
input_day.setName("input_day");
input_day.setBounds(102, 37, 25, 20);
input_day.setColumns(10);
and in the other method I need these variables:
input_datum.setText(reportDate);
if(check_datum.isSelected()){
CustomDateFinal[0] = datumvar;
input_datum.setText(CustomDateFinal[0]);
}
Don't care for the others but how for example do I get "reportDate"? Thanks in advance :)
EDIT: I want the variables from "createFields" to "customKeyevent" PICTURE