Wrox Programmer Forums
|
Java GUI Discussions specific to programming Java GUI.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java GUI section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 24th, 2006, 08:39 AM
Registered User
 
Join Date: Apr 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default simple GUI

I have written a simple java program

I run it using
  >javac abc.java //compile

   >java abc //run
from the command prompt

I have no experience in creating gui in any Prog Lang
i need to design a simple gui,just having a single button,that
when clicked does the job of "javac & java"
   my program is very simple .it has 3 modes of running,which I have to
specify by passing parameters at command line.


please guide me in designing the gui for normal mode.
(in normal mode i don't have to pass any parameters at command line)
just: >javac abc.java
      >java abc
then,I will manage for other modes.

One of my friends was saying that,u have to create an html file
having a 'link' that is connected to javac command,but unfortunately,he is out of touch with 'gui's and does'nt remember exactly

please help and send the code(i guess ,which applies to all progs)
soon.it is urgent,and i am having a tough time studying it from books.

Thank you

 
Old April 30th, 2006, 06:41 AM
Registered User
 
Join Date: Apr 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to tom5ive
Default

import java.util.Scanner;

public class Terminal
{
    public static void main(String[] args)
    {
             String ver = "JTerminal 1.0";
         Scanner in = new Scanner(System.in);

         System.out.println("\t\t\t Welcome to JTerminal");
         Boolean syn = false;

       while(true)
       {
          String load = in.next();

         if (load.equals("com?"))
         {
            // System.out.println("\"<command>\" - <Description>\n");
            // remove the "<" and ">"
            System.out.print("Commands\n");
            System.out.print("\"Calculator\" - Calculator\n");
            System.out.print("\"ver?\" - Displays JTerminal Version\n");
             System.out.print("\"contact?\" - Contact Information\n");
            System.out.print("\"50cent\" - Launches Alpha 50cent game\n");
            System.out.print("\"exit\" - Exit JTerminal\n");
            System.out.print("\"se\" - Source Editor, for creating code.\n");
            System.out.print("\"jtc <file>\" - To compile your code\n");
            System.out.print("\"jtc?\" - More info on jtc command\n");
            System.out.print("\"jtrun <file>\" - run a custom JTerminal program\n");

            syn = true;

         }

         if (load.equals("ver?"))
            {
               System.out.print(ver + "\n");
               syn = true;
            }

         if(load.equals("exit"))
            {
               break;
            }
         if (syn == false)
         {
            System.out.println("'" + load + "' is not a valid command in JTerminal");
         }




       }

    }
}







Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i pass value for GUI? redprawn_89 C# 2005 2 June 3rd, 2008 08:09 PM
Gui program P.Wheat Windows Server 0 February 23rd, 2008 11:06 PM
C# GUI Seperation lesliev C# 0 September 17th, 2006 03:03 PM
GUI questions hlchuah77 Java GUI 2 August 24th, 2004 09:23 AM
help in GUI khfarooq Java GUI 5 August 22nd, 2004 05:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.