hey, i'm trying to create a program that results in 2 GUI's. the first would be a prompt for the user to input information, and the second would have the inputted information as well as a few sentences-appear on it.
my real goal isn't the result so much as understanding the process of making GUI output based on the user's input as opposed to the programmers.
that being the case, i'm not looking for a package to do my work for me, I'm looking to make the code from (relative) scratch...
to do this, I tried manipulating the code for GUI that I happened to know-to include the Scanner class, that is, to allow for the users input...but its not working.
for all intents and purposes, assume all output (e.g all 'println') are meant to be on the GUI
also, I kept my notes in there, I hope they're more helpful than distracting
(read them as a reflection of my thought process. they in no way dictate the "correct" way of carrying my goals out)
heres the first class
the second class //this is the execution class for SequenceOptions
darn. i want to put the users name onto the GUI but the Scanner code is outside the GUI coding
Im SURE this has been dealt with before. the basic question is
1)how make a GUI that prints Scannernextline or whatever
2)how do i make multiple GUI without having to write the same code over and over?
my aim is to make one pane a prompt for user name
and a second pane that outputs the inputted name (as well as other words)
Don't attempt to combine logic and display. The GUI classes are for display and there are other classes for the logic. Make sure to keep them separate. You should not therefore use a Scanner or System.out as well as the GUI. You should get the logic working before you try going near the GUI. You can have a class like thisAnd you call it like this:-When you have that sort of thing working, then consider a GUI. I suggest you have a controlling class which has a NameMessage object and a GUI as fields. You can enter the name in something like a text field and print the message to a label. You will want a button or menu item or similar to create a new NameMessage object and display its message.
But once you start using a GUI, use that exclusively. And when I said a GUI I meant a GUI. You do not want two GUIs in one application. You can have several components in the same frame, or show dialogue windows, but don't attempt to use two frames.
The text field I'm sure is what he'd go for and he should... I've only used the label and button combination to demonstrate a simple and quick application for the functionality that I'm assuming he's looking for... I've also deliberately chosen those two so he can implement the real stuff on his own...