I got a Main class and another Class which extends a jFrame, which holds directly a jTable in it. I kinda want to stop the code from executing until something happens (= the User presses Enter). I then want to get the values of the selected row from the table which I am holding in my other class MyJFrame. As for now, I am trying to achieve this about like that:
ArrayList<String[]> result = new ArrayList<String[]>();
String[ ] columns = new String[] {"h1", "h2", "h3" };
result.add(new String[]{ "some", "test", "values" });
result.add(new String[]{ "some", "test", "values" });
ArrayListTableModel model = new ArrayListTableModel(result, columns);
//waiting for enter...
MyJFrame frame = new MyJFrame(model);
int row = frame.getActiveRow();
selectedData = result.get(row);
PS: I hope you understand my problem, I had some trouble explaining it...