java - Create a JFrame from a class and take input from it -


i'm little confused how achieve want implement. in main java class want able call multiple jframes things settings. have gui in main class set up; want buttons call separate jframes , capture user input, returning main class processing. this:

public class main extends jframe{      public main(){}       button.addactionlistener(new actionlistener() {           public void actionperformed(actionevent e) {                new settings();           }      }); }  public class settings extends jframe{      submit.addactionlistener(new actionlistener() {           public void actionperformed(actionevent e) {                //capture data , return main           }      }); } 

i'm not sure if i'm going right way this. want little popups in different java files ease of use.

i think not need jframe settings.
in java there object joptionpane , need.

here got example:

string[] levels = {"easy", "medium", "gomoku"}; int result = joptionpane.showoptiondialog(null,                     "choose level:", "ox level",                     joptionpane.ok_cancel_option,                     joptionpane.question_message,                     null, levels, levels[0]); 

here got tutorial: how make dialogs


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -