Java GUI developing question

Status
Not open for further replies.

orestis

Ars Tribunus Militum
1,598
Ok, I decided to start my pet project, but since I'm a newbie I want to focus on the real mechanics of the problem and don't want to be concerned about GUIs and Swing until everything is ready. For using my growing app I was thinking along the lines of printing a menu on-screen and requesting a number to do a certain thing- you know how it is: good old fashioned stuff.

Any suggestions of a good implementation of this ?
 

MaximDiscord

Smack-Fu Master, in training
75
If you are willing to spend just a few hours learning, it won't take you long to become somewhat familiar with how to create a stand alone java app with a GUI.

Honestly, it takes less than a minute to create a simple application with a Label for output and some buttons and textfields for input. It sounds like you will spend just as much time designing the menu system you just described as you would learning how to use Swing and create your own GUI.

Even the GridBagLayout layout manager (supposedly every java programmers worst nightmare) is really simple. Give it a shot, you will be glad you did.
 
Can you help me about reading the input ? I can find many stuff about displaying stuff on the screen but nothing about reading from the keyboard.

Handling input:

java.io;
java.lang.System.in;
*Reader classes

Example:

code:<HR>
Code:
BufferedReader console = new BufferedReader(new InputStreamReader(System.in));
System.out.println(" What do you want Level_7 ? ");
String command = null;
try
{
	command = console.readLine();
}
catch(IOException e)
{
	command = new String("Error :" + e); 
}
System.out.println("Command received: " + command);

Look throught java.io and java.lang.System for other Readers and Streams.

If you don't have it already, get the defacto book on Java:
Java in a Nutshell
 
Status
Not open for further replies.