I am new in java.
I try to make a program and I have a question.
import java.util.Arrays;
public class AccessFIleTest
{//start of class AccessFIleTest
//variables here
public static void main(String[] args)
{//start of main method
String pinakas[]=new String[3];
ReturnSQLConnectionOptions newOptions= new ReturnSQLConnectionOptions();
pinakas=newOptions.getPinakastimon();
System.out.println(Arrays.toString(pinakas));
}//end of main method
}//end of class AccessFIleTest
So the newOptions checks if a spesific file exists! If it does then it reads the contents and put them in the array pinakas and everythig works great.
If not it shows a jframe window that the user has to put the values, then stores the file and also returns on the getPinakastimon() the values the user insert.
The problem is that this code here even the window that waits the values is visible and waiting data from user procedds to print the pinakas array that ofcourse is empty till that moment.
Any help?
Thank you in advance!
Use a JDialog instead, this should show you how to setup one to accept a user entered String http://docs.oracle.com/javase/tutorial/uiswing/components/dialog.html#input