I need to display result of computation that I used to compile in standard java programming (in Main clas) in java swing GUI test area in netbeans, but I always encountering problem on it. I bet the problem is because my String to be printed is not available in the GUI class, here's my part of code in swing
private void predictActionPerformed(java.awt.event.ActionEvent evt) {
TextArea1.setText(Engine.Print.printresult(toarray));
//JOptionPane.showMessageDialog(null,Engine.Print.printresult(toarray));
// TextArea1.setText(Retrieving.main(args));
}
and here's the code in package Engine, Class Print, method printresult, String[]printresult is passed from another class and it works to run directly without GUI:
public static void printresult(String[]toarray){
for(int a=0; a<toarray.length;a++){
System.out.println(toarray[a]);
}
really need help. thank you