Simple Program Help Plz :)

Hi. I need help creating the SIMPLEST of simple address books. I need to have it Add , Delete, Modify, and View entries. It doesnt have to have a GUI , just a simple and easy to use menu. It can be an applet but its not necessary. Thanks,

..ppffftt..cross post
http://forum.java.sun.com/thread.jsp?forum=54&thread=389298&tstart=0&trange=100

Similar Messages

  • Lol, im a newbie. Completely new. Simple programming help, getting started.

    Im completely new to programming, and i want to just figure out how to make a program that shows a bit of text, and just an about that shows an icon and a bit more text. Thats it for now. I figured out how to use Interface Builder to make the interface i need, i also figured out where to put the main.nib file and also how to turn a folder into an application, i just need to know how to make the other files. If there is a tutorial for the very basics of making a form and making it into an application, sorry i didn't find it. Any help appreciated.
    Thanks!

    Hello,
    you simply started with the second step before the first: A .nib file is part of a program, and not the other way round.
    1.: Start XCode.
    2.: Use File=>New Project...
    3.: Choose "Cocoa Application"
    4.: Give it a name, e.g. "SmallApp"
    5.: In the "SmallApp" window, double-click the "MainMenu.xib" file
    6.: Now you're in the IBuilder - here you can edit the interface
    7.: Save & Quit IBuilder
    8.: Back in Xcode - press <cmd>-<Return> (for Build & Run)
    9.: Now you should have a working SmallApp.app

  • Simple program help

    Mission: Create a Java-program which asks and reads three words separatedly. These words will be printed starting from the shortest. If the length of two or more words is the same, whatever can be printed first.
    Ive only recently started programming and I should submit this program on thursday. If you can give me instructions where to start or direct to a page which explains it, or code the whole thing ready since it should be pretty easy, Id be grateful extraordinaire.
    -renney

    This is one of those rare cases where having the class textbook really helps. In order to do this assignment, you need to learn how to read a string in from a prompt (that you specify) or from the command line, how to print a string to the screen, how to compare two strings, and some very basic flow control.
    The online java tutorials and APIs here are really good at explaining how to do all this except for the read a string in from a prompt task. I have seen maybe four or five different ways of doing this because most Java programs don't require this sort of input.
    Unfortunately, if we give you an answer, your professor may realize that you didn't learn from the textbook and flunk you for cheating. (Why didn't you use the method outlined here? If this is your first time studying Java, why are you writing code like 5 year veterans?)
    But relax. Three days is plenty of time to learn how to do this. :)

  • Simple Program Help - Start allowing focus requirement

    Hello,
    how do I Start allowing focus requirement: (eg: constructor). I am not sure what you mean by this.
    I did what was recommended to complete this as follows:
    public void start () {
         hoursInput.requestFocus();}     
    public void init ()     {
    hoursInput = new JTextField ( 4 );
         hoursInput.setRequestFocusEnabled(true);
         c.add (hoursInput );
    I'm not sure where I can put this at though in my program:
    add FocusListener (
    new FocusAdapter()
    Any suggestions?

    Here is all of my code. I basically want to allow the insertion point to be placed in the jtextfield hoursInput. I have tried to code it, b ut I need to someone to take a look if possible at what i am doing wrong.
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.text.*;
    import java.util.Locale;
    public class calculatedCharges extends JApplet implements ActionListener {
         JTextField hoursInput, RunnTotal, CustCharge;
         JLabel hoursPrompt, RunnTotalL, CustChargeL;
         double fee = 0, total;
         String Fees, RunnTotals;
    public void init ()     {
         Container c = getContentPane ();
         c.setLayout ( new FlowLayout () );
         hoursPrompt = new JLabel ( "Enter number of hours:" );
         c.add (hoursPrompt);
         hoursInput = new JTextField ( 4 );
         addFocusListener (
         new FocusAdapter() {
         hoursInput.setRequestFocusEnabled(true);
         c.add (hoursInput );
         CustChargeL = new JLabel ("Current Charge: " );
         c.add ( CustChargeL );
         CustCharge = new JTextField ( 4 );
         CustCharge.setEditable ( false );
         c.add ( CustCharge );
         RunnTotalL = new JLabel ("Running Total: " );
         c.add ( RunnTotalL );
         RunnTotal = new JTextField ( 8 );
         RunnTotal.setEditable ( false );
         c.add ( RunnTotal );
         hoursInput.addActionListener ( this );
    public void start () {
    hoursInput.requestFocus();          }     
    public void actionPerformed ( ActionEvent e ) {
    NumberFormat moneyFormat = NumberFormat.getCurrencyInstance ( Locale.US );
         double hours = Double.parseDouble ( e.getActionCommand () );
              fee = calculateCharges ( hours );
              String Fee = moneyFormat.format ( fee );
              CustCharge.setText ( Fee );
              showStatus ( "Processing Complete" );
         public double calculateCharges ( double hours ) {
              double charge = 0.0;
    NumberFormat moneyFormat = NumberFormat.getCurrencyInstance ( Locale.US );
         if ( hours <= 3.0 && hours > 0.0 )
              charge = 2.0;     
         else if ( hours > 3.0 && hours <= 19.0 )
              charge = 2.0 + 0.50 * Math.ceil ( hours - 3.0 );
         else if ( hours > 19.0 )
              charge = 10.0;     
         total = total + charge;
         String RunnTotals = moneyFormat.format ( total );
         RunnTotal.setText ( RunnTotals );
         return charge;
         }

  • Executing HelloWorld program in EJB java.lang.NoClassDefFoundError-help plz

    Hi
    I am a tyro to Weblogic 8.1 server with EJB. I am Running a simple HeloWorld program ,but it throws No class def found err. Below i listed my program.help needed.
    Home interface
    package examples;
    import java.rmi.*;
    import javax.ejb.*;
    public interface HelloWorldHome extends EJBHome {
    public HelloWorld create() throws CreateException,RemoteException;
    Remote interface:
    package examples;
    import java.rmi.*;
    import javax.ejb.*;
    public interface HelloWorld extends EJBObject
    public String getHelloWorldMsg () throws RemoteException;
    HelloWorldLocal-- Remote
    package examples;
    import javax.ejb.*;
    public interface HelloWorldLocal extends EJBLocalObject
    public String getHelloWorldMsg();
    HelloWorldLocalHome:
    package examples;
    import javax.ejb.*;
    public interface HelloWorldLocalHome extends EJBLocalHome
    HelloWorldLocal create() throws CreateException;
    HelloWorldBean:
    package examples;
    import javax.ejb.*;
    import javax.SessionContext;
    public class HelloWorldBean implements SessionBean
    public HelloWorldBean() {}
    private void log(String s) {
    if (true) System.out.println(s);
    public void ejbActivate() {}
    public void ejbPassivate() {}
    public void ejbRemove() {
    log("ejbRemove() called");
    public void setSessionContext(SessionContext ctx) {
    log("setSessionContext called");
    this.ctx = ctx;
    public void ejbCreate() throws CreateException {
    log("ejbCreate() called");
    public String getHelloWorldMsg () {
    log("Bean Method called");
    return ("Stateless SessionBean says Hello World");
    Client program
    package examples;
    import java.rmi.*;
    import javax.rmi.PortableRemoteObject;
    import javax.naming.*;
    import java.util.*;
    import examples.HelloWorldHome;
    import examples.HelloWorld;
    * This class is an example of client code that calls
    * methods on a simple stateless session bean.
    public class HelloWorldClient {
    private static Context createJNDIContext()
    throws NamingException, RemoteException {
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    env.put(Context.PROVIDER_URL,"t3://localhost:7001");
    Context context = new InitialContext( env );
    return context;
    * Main method to unit test the HelloWorld API
    public static void main(String[] args) {
    try
    // use JNDI to look up the home interface for HelloWorld
    Context context = createJNDIContext();
    // You could use the following statement to retrieve
    // the HelloWorld home
    /* HelloWorldHome home =
    (HelloWorldHome)
    context.lookup("examples.HelloWorldHome"); */
    // However, using javax.rmi.PortableRemoteObject
    // allows you to narrow the scope
    // to the home interface
    HelloWorldHome home = (HelloWorldHome )
    PortableRemoteObject.narrow(
    context.lookup("examples.HelloWorldHome"),
    examples.HelloWorldHome.class ) ;
    HelloWorld hello = home.create();
    * The EJBObject will delegate the call to the HelloWorld
    * session bean, receive the result, and return it to this client.
    System.out.println(hello.hello());
    * Remove the EJBObject.
    * The container will mark the EJBObject for destruction.
    hello.remove();
    catch( Exception err )
    System.err.println( err.toString() );
    and also i put Class path in sys variables.I don't know reason y not running .help needed.
    bye

    Client program , No class def found exception.Create an ejb-client.jar containing only the home and remote interfaces for the EJB and add them to the classpath while executing the client code. You could also copy the EJB JAR for that.

  • Please help me with simple program

    Can someone please write a simple program for me that opens up a webpage in the center of the screen , with a set size, and then asks the user where they would like to click on the screen. Then once the person clicks it asks how many times they would like to click there, and then once they enter the # the program opens up the webpage (in the center at the same spot as before, with the same set size) and automatically clicks on the predesignated spot , and then closes all open internet windows, and keeps doing it for however many times the person chose. PLEASE HELP ME WITH THIS!!! If you could, please post the source code here. Thank you so much to whoever helps me!!!!!!!

    If it's not to learn, then what is the purpose of
    this project?well, if it's not HW and its not for learning java, then why the hell would anyone like to have a program that may open a webpage and then repeatedly click on predefined place...
    let me see...
    now if he had asked for program that fakes IP as well, then i would suggest that he tryes to generate unique clicks, but now... i'm not sure... maybe just voting in some polls or smthing... though, i would not create a program that clicks on the link or form element, but rather just reload url with given parameters for N times...

  • Need help with a simple program (should be simple anyway)

    I'm (starting to begin) writing a nice simple program that should be easy however I'm stuck on how to make the "New" button in the file menu clear all the fields. Any help? I'll attach the code below.
    ====================================================
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Message extends JFrame implements ActionListener {
         public void actionPerformed(ActionEvent evt) {
         text1.setText(" ");
         text2.setText("RE: ");
         text3.setText(" ");
         public Message() {
         super("Write a Message - by Kieran Hannigan");
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         setSize(370,270);
         FlowLayout flo = new FlowLayout(FlowLayout.RIGHT);
         setLayout(flo);
         //Make the bar
         JMenuBar bar = new JMenuBar();
         //Make "File" on Menu
         JMenu File = new JMenu("File");
         JMenuItem f1 = new JMenuItem("New");f1.addActionListener(this);
         JMenuItem f2 = new JMenuItem("Open");
         JMenuItem f3 = new JMenuItem("Save");
         JMenuItem f4 = new JMenuItem("Save As");
         JMenuItem f5 = new JMenuItem("Exit");
         File.add(f1);
         File.add(f2);
         File.add(f3);
         File.add(f4);
         File.add(f5);
         bar.add(File);
         //Make "Edit" on menu
         JMenu Edit = new JMenu("Edit");
         JMenuItem e1 = new JMenuItem("Cut");
         JMenuItem e2 = new JMenuItem("Paste");
         JMenuItem e3 = new JMenuItem("Copy");
         JMenuItem e4 = new JMenuItem("Repeat");
         JMenuItem e5 = new JMenuItem("Undo");
         Edit.add(e5);
         Edit.add(e4);
         Edit.add(e1);
         Edit.add(e3);
         Edit.add(e2);
         bar.add(Edit);
         //Make "View" on menu
         JMenu View = new JMenu("View");
         JMenuItem v1 = new JMenuItem("Bold");
         JMenuItem v2 = new JMenuItem("Italic");
         JMenuItem v3 = new JMenuItem("Normal");
         JMenuItem v4 = new JMenuItem("Bold-Italic");
         View.add(v1);
         View.add(v2);
         View.add(v3);
         View.addSeparator();
         View.add(v4);
         bar.add(View);
         //Make "Help" on menu
         JMenu Help = new JMenu("Help");
         JMenuItem h1 = new JMenuItem("Help Online");
         JMenuItem h2 = new JMenuItem("E-mail Programmer");
         Help.add(h1);
         Help.add(h2);
         bar.add(Help);
         setJMenuBar(bar);
         //Make Contents of window.
         //Make "Subject" text field
         JPanel row2 = new JPanel();
         JLabel sublabel = new JLabel("Subject:");
         row2.add(sublabel);
         JTextField text2 = new JTextField("RE:",24);
         row2.add(text2);
         //Make "To" text field
         JPanel row1 = new JPanel();
         JLabel tolabel = new JLabel("To:");
         row1.add(tolabel);
         JTextField text1 = new JTextField(24);
         row1.add(text1);
         //Make "Message" text area
         JPanel row3 = new JPanel();
         JLabel Meslabel = new JLabel("Message:");
         row3.add(Meslabel);
         JTextArea text3 = new JTextArea(6,22);
         messagearea.setLineWrap(true);
         messagearea.setWrapStyleWord(true);
         JScrollPane scroll = new JScrollPane(text3,
                                  JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                                  JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
         //SpaceLine
         JPanel spaceline = new JPanel();
         JLabel spacer = new JLabel(" ");
         spaceline.add(spacer);
         row3.add(scroll);
         add(row1);
         add(row2);
         add(spaceline);
         add(spaceline);
         add(row3);
         setVisible(true);
         public static void main(String[] arguments) {
         Message Message = new Message();
    }

    persiandude wrote:
    Topic: Need help with if, else, and which statements and loops.
    How would I display 60 < temp. <= 85 in java
    System.out.println("60 < temp. <= 85 in java");
    another question is how do I ask a question like want to try again (y/n) after a output and asking that everytime I type in yes after a output and terminate when saying No.Sun's [basic Java tutorial|http://java.sun.com/docs/books/tutorial/]
    Sun's [New To Java Center|http://java.sun.com/learning/new2java/index.html].Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
    [http://javaalmanac.com|http://javaalmanac.com]. A couple dozen code examples that supplement [The Java Developers Almanac|http://www.amazon.com/exec/obidos/tg/detail/-/0201752808?v=glance].
    jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
    JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
    Bruce Eckel's [Thinking in Java|http://mindview.net/Books/DownloadSites] (Available online.)
    Joshua Bloch's [Effective Java|http://www.amazon.com/Effective-Java-2nd-Joshua-Bloch/dp/0321356683/ref=pd_bbs_1?ie=UTF8&s=books&qid=1214349768&sr=8-1]
    Bert Bates and Kathy Sierra's [Head First Java|http://www.amazon.com/exec/obidos/tg/detail/-/0596004656?v=glance].
    James Gosling's [The Java Programming Language|http://www.bookpool.com/sm/0321349806].

  • Help with a simple program.

    I need some help writing a simple program. Can anybody help??
    thanks to all.
    2. HTML Java Source Code Reserved Word Highlighter
    Write a program that inputs a Java source code file and outputs a copy of that file with Java keywords surrounded with HTML tags for bold type. For example this input:
    public class JavaSource
    public static void main ( String[] args )
    if ( args.length == 3 )
    new BigObject();
    else
    System.out.println("Too few arguments.");
    will be transformed into:
    <B>public</B> <B>class</B> JavaSource
    <B>public</B> <B>static</B> <B>void</B> main ( String[] args )
    <B>if</B> ( args.length == 3 )
    <B>new</B> BigObject();
    <B>else</B>
    System.out.println("Too few arguments.");
    In a browser the code will look like this:
    public class JavaSource
    public static void main ( String[] args )
    if ( args.length == 3 )
    new BigObject();
    else
    System.out.println("Too few arguments.");

    Here is something that may get you started...
    import java.io.*; 
    import java.util.*; 
    public class HtmlJava{
         public static void main(String arg[]){
              if(arg.length!=1){
                   System.out.println("Usage java HtmlJava sourceFile");       
              else
                   new HtmlJava(arg[0]);
         HtmlJava(String source){
              try{
                   BufferedReader sourceReader=new BufferedReader(new InputStreamReader(new FileInputStream(source)));
                   BufferedWriter writer=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(source+"Html.txt")));  
                   Vector keywords=new Vector();
                   addKeywords(keywords);
                   String line;
                   StringTokenizer tokenizer=null;
                   String word;
                   while((line=sourceReader.readLine () )!=null){
                        tokenizer=new StringTokenizer(line);
                        while(tokenizer.hasMoreTokens()){
                             word=tokenizer.nextToken();
                             if(keywords.contains(word)){
                                  writer.write(""+word+" ");
                             else{
                                  writer.write(word+" ");
                        writer.write("\r\n");
                   writer.close();
                   sourceReader.close(); 
                   System.out.println("Output File written to "+source+"Html.txt"); 
              catch(Exception ex){
                   ex.printStackTrace();      
         private void addKeywords(Vector keywords){
              keywords.addElement ( "abstract");
              keywords.addElement( "boolean");
              keywords.addElement( "break");
              keywords.addElement( "byte");
              keywords.addElement( "byvalue");
              keywords.addElement( "case");
              keywords.addElement( "cast");
              keywords.addElement( "catch");
              keywords.addElement( "char");
              keywords.addElement( "class");
              keywords.addElement( "const");
              keywords.addElement( "continue");
              keywords.addElement( "default");
              keywords.addElement( "do");
              keywords.addElement( "double");
              keywords.addElement( "else");
              keywords.addElement( "extends");
              keywords.addElement( "false");
              keywords.addElement( "final");
              keywords.addElement( "finally");
              keywords.addElement( "float");
              keywords.addElement( "for");
              keywords.addElement( "future");
              keywords.addElement( "generic");
              keywords.addElement( "goto");
              keywords.addElement( "if");
              keywords.addElement( "implements");
              keywords.addElement( "import");
              keywords.addElement( "inner");
              keywords.addElement( "instanceof");
              keywords.addElement( "int");
              keywords.addElement( "interface");
              keywords.addElement( "long");
              keywords.addElement( "native");
              keywords.addElement( "new");
              keywords.addElement( "null");
              keywords.addElement( "operator");
              keywords.addElement( "outer");
              keywords.addElement( "package");
              keywords.addElement( "private");
              keywords.addElement( "protected");
              keywords.addElement( "public");
              keywords.addElement( "rest");
              keywords.addElement( "return");
              keywords.addElement( "short");
              keywords.addElement( "static");
              keywords.addElement( "super");
              keywords.addElement( "switch");
              keywords.addElement( "synchronized");
              keywords.addElement( "this");
              keywords.addElement( "throw");
              keywords.addElement( "throws");
              keywords.addElement( "transient");
              keywords.addElement( "true");
              keywords.addElement( "try");
              keywords.addElement( "var");
              keywords.addElement( "void");
              keywords.addElement( "volatile");
              keywords.addElement( "while");
    }Hope it helped

  • Ideas For a Simple Program?

    I need some ideas for a simple program for a project in class. Can anyone help me?

    Import Classes
    import java.io.*;
    public class tictactoe
    Define Variables
    public static InputStreamReader ISR = new InputStreamReader(System.in);
    public static BufferedReader BFR = new BufferedReader(ISR);
    public static String BOX[][] = new String[3][3]; //Integer Arry for tictactoe box
    public static String PName; //Moving Player's Name
    public static String P1Name; //Player 1 Name
    public static String P2Name; //Player 2 Name
    public static String InputPLY; //X or O
    public static String InputStr; //Player's Input
    public static boolean BreakLoop; //Set this to true in PlayGame() to exit
    public static void main(String args[]) throws IOException
    InputPLY = "O";
    BreakLoop = false;
    ClearBOXCache();
    PrintCredits();
    System.out.println("");
    System.out.println("PLEASE ENTER PLAYER 1 NAME");
    P1Name = BFR.readLine();
    System.out.println("PLEASE ENTER PLAYER 2 NAME");
    P2Name = BFR.readLine();
    System.out.println("");
    System.out.print("\nWelcome ");
    System.out.print(P1Name);
    System.out.print(" and ");
    System.out.println(P2Name);
    System.out.println("");
    System.out.println(P1Name + " = X");
    System.out.println(P2Name + " = O");
    PlayGame();
    PrintCredits();
    BFR.readLine();
    System.exit(0);
    public static void DrawGrid()
    This function is to draw the tictactoe grid.
    System.out.println("");
    System.out.println("\t/-----------------------------\\");
    System.out.println("\t|-------- TIC TAC TOE --------|");
    System.out.println("\t|-----------------------------|");
    System.out.println("\t| | | |");
    System.out.println("\t| " + BOX[0][0] + " | " + BOX[0][1] + " | " + BOX[0][2] + " |");
    System.out.println("\t| | | |");
    System.out.println("\t|-----------------------------|");
    System.out.println("\t| | | |");
    System.out.println("\t| " + BOX[1][0] + " | " + BOX[1][1] + " | " + BOX[1][2] + " |");
    System.out.println("\t| | | |");
    System.out.println("\t|-----------------------------|");
    System.out.println("\t| | | |");
    System.out.println("\t| " + BOX[2][0] + " | " + BOX[2][1] + " | " + BOX[2][2] + " |");
    System.out.println("\t| | | |");
    System.out.println("\t\\-----------------------------/");
    public static void PrintCredits()
    This function is to print credits. Intended for startup and ending
    System.out.println("");
    System.out.println("");
    System.out.println("\t-------------------------------");
    System.out.println("\t--------- TIC TAC TOE ---------");
    System.out.println("\t-------------------------------");
    System.out.println("");
    System.out.println("\t-------------------------------");
    System.out.println("\t---- MADE BY WILLIAM CHAN! ----");
    System.out.println("\t-------------------------------");
    public static void ClearBOXCache()
    This function is to clear the BOX's cache.
    It is intended for restarting a game     
    BOX[0][0] = " ";
    BOX[0][1] = " ";
    BOX[0][2] = " ";
    BOX[1][0] = " ";
    BOX[1][1] = " ";
    BOX[1][2] = " ";
    BOX[2][0] = " ";
    BOX[2][1] = " ";
    BOX[2][2] = " ";
    public static void CheckWin(String PLYW) throws IOException
    This function is to check if a player wins
    for (int X = 0; X < 3; X++)
    if (BOX[X][0].equals(PLYW) && BOX[X][1].equals(PLYW) && BOX[X][2].equals(PLYW))
    PrintWin(PLYW);
    for (int Y = 0; Y < 3; Y++)
    if (BOX[0][Y].equals(PLYW) && BOX[1][Y].equals(PLYW) && BOX[2][Y].equals(PLYW))
    PrintWin(PLYW);
    if (BOX[0][0].equals(PLYW) && BOX[1][1].equals(PLYW) && BOX[2][2].equals(PLYW))
    PrintWin(PLYW);
    else if (BOX[0][2].equals(PLYW) && BOX[1][1].equals(PLYW) && BOX[2][0].equals(PLYW))
    PrintWin(PLYW);
    else if (!BOX[0][0].equals(" ") && !BOX[0][1].equals(" ") && !BOX[0][2].equals(" ") && !BOX[1][0].equals(" ") && !BOX[1][1].equals(" ") && !BOX[1][2].equals(" ") && !BOX[2][0].equals(" ") && !BOX[2][1].equals(" ") && !BOX[2][2].equals(" "))
    ClearBOXCache();
    System.out.println("Tie Game!");
    BFR.readLine();
    System.out.println("Game has restarted");
    public static void PrintWin(String PrintWinner) throws IOException
    This function is to print which player won
    if (PrintWinner.equals("X"))
    System.out.println(P1Name + " wins!");
    System.out.println(P2Name + " loses!");
    else if (PrintWinner.equals("O"))
    System.out.println(P2Name + " wins!");
    System.out.println(P1Name + " loses!");
    BFR.readLine();
    ClearBOXCache();
    System.out.println("Game has restarted!");
    public static void PrintInstruction(String PLYINSTR)
    This function is to give instruction to the player
    if (PLYINSTR.equals("X"))
    PName = (P1Name);
    else if (PLYINSTR.equals("O"))
    PName = (P2Name);
    System.out.println("");
    System.out.println(PName + ":");
    System.out.println("PLEASE MAKE YOUR MOVE");
    System.out.println("");
    System.out.println("TL = TOP LEFT BOX, TM = TOP MIDDLE BOX, TR = TOP RIGHT BOX");
    System.out.println("ML = MIDDLE LEFT BOX, MM = MIDDLE MIDDLE BOX, MR = MIDDLE RIGHT BOX");
    System.out.println("BL = BOTTOM LEFT BOX, BM = BOTTOM MIDDLE BOX, BR = BOTTOM RIGHT BOX");
    public static void PlayGame() throws IOException
    This function is the main game function.
    It calls other game functions.         
    Define Variables
    while(true)
    if (InputPLY.equals("O"))
    InputPLY = "X";
    else if (InputPLY.equals("X"))
    InputPLY = "O";
    while(true)
    PrintInstruction(InputPLY);
    InputStr = BFR.readLine(); //Player's move
    Check player's move
    if (InputStr.equals("TL"))
    if (BOX[0][0].equals(" "))
    BOX[0][0] = InputPLY;
    break;
    else if (InputStr.equals("TM"))
    if (BOX[0][1].equals(" "))
    BOX[0][1] = InputPLY;
    break;
    else if (InputStr.equals("TR"))
    if (BOX[0][2].equals(" "))
    BOX[0][2] = InputPLY;
    break;
    else if (InputStr.equals("ML"))
    if (BOX[1][0].equals(" "))
    BOX[1][0] = InputPLY;
    break;
    else if (InputStr.equals("MM"))
    if (BOX[1][1].equals(" "))
    BOX[1][1] = InputPLY;
    break;
    else if (InputStr.equals("MR"))
    if (BOX[1][2].equals(" "))
    BOX[1][2] = InputPLY;
    break;
    else if (InputStr.equals("BL"))
    if (BOX[2][0].equals(" "))
    BOX[2][0] = InputPLY;
    break;
    else if (InputStr.equals("BM"))
    if (BOX[2][1].equals(" "))
    BOX[2][1] = InputPLY;
    break;
    else if (InputStr.equals("BR"))
    if (BOX[2][2].equals(" "))
    BOX[2][2] = InputPLY;
    break;
    else if (InputStr.equals("RESTART"))
    ClearBOXCache();
    System.out.println("");
    System.out.println("GAME RESTARTED!");
    System.out.println("");
    break;
    else if (InputStr.equals("QUIT"))
    BreakLoop = true;
    break;
    if (BreakLoop == true)
    break;
    DrawGrid();
    CheckWin(InputPLY);
    }

  • Even a simple program is not working ?

    Hi there,
    I typed a simple program to display the customer details. The program goes like this :
    import java.lang.*;
    public class Customer
         String custname;
         String custID;
    public Customer()
         custname = "Bob";
         custID = "S20010";
    public void displaydetails()
         System.out.println("Customer name is " + custname);
         System.out.println("Customer ID is " + custID);
    public static void main(String a[])
         Customer cust = new Customer();
         cust.displaydetails();
    The compilation went right. But, when I executed the program the following error message is displayed :
    c:\>java Customer.java
    Exception in thread "main" java.lang.NoClassDefFoundError: Customer/java.
    Please help !!

    Don't cross-post.
    http://forum.java.sun.com/thread.jspa?threadID=576890&messageID=2891064#2891064

  • How can i make simple program to match colors ?(photos taken by camera)

    how can i make simple program to match colors ?(photos taken by camera)

    Hi khaledyr,
    use a "random number" and compare for ">0.5" to get a (1 or 0) signal
    What exactly are you searching for?
    - Hints for choosing hardware?
    - How to output voltage or relais signals?
    - Help on using DAQ(mx)?
    - Help on generating (boolean) waveforms?
    Message Edited by GerdW on 04-16-2010 08:15 AM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Why can't there be a simple program to setup remote file sharing?

    If someone wants to take a crack at getting my Time Capsule available remotely (off network over internet), I would appreciate it.
    I am a graphic designer and use the other side of my brain. DNS, static IP, MAC address etc is very confusing.
    I purchased a neat little app called Connect360 for Mac that automatically configures music/video sharing to Xbox360 from MacBook Pro. Evrything is automatic. Brilliant. If someone could do that to configure internet file sharing, it would be worth $$$$$$.
    Thanks

    You cannot do a simple program with the multiplicity of internet connections, modem type, ISP types, authentication types. Also you notice that Apple decided everything should now happen from the cloud, so cancelled the mobileme service which did offer easier setup for something that is far more limited, at least for now.
    Also please note there are fridge mechanics who fix fridges and car mechanics who fix cars. Photographers who make a living taking better photos than I can, and computer technicians who do network setups. If you don't fix your car or the washing machine.. why do you need to fix your internet networking?? Pay someone to do it.. but Steve said computers are easy and you got a false impression that everything should just plug together and work.. well it doesn't. Find a tame Computer tech and let him/her carry that part of your business. Spend your time doing what earns you money instead of in frustration at fixing the fridge. (Being symbolic of the computer network).
    It is rather like when I (a computer technician) dabble in graphic design.. I do, and you laugh at the results.. !!
    Please note I no longer work in that field because the pay is miserable, the customers ring up day and night and scream at you that the network is down and it is all your fault, and want you to spend an hour on the phone helping them. No service fee of course. You should on the basis of a single job, help connect their computer to the printer over the phone for an hour, rather than pay you a service call. Since computers are easy and you should just donate your time and life really to helping them do what Steve and Bill said was so easy.

  • Simple programming on mobile

    Hi,
    I just wonder if there are any applications for my symbian anna phone (C7) which will allow me to write simple programs, please.
    I would like to write a program that asks for user input (numbers) and outputs a result after applying a formula.
    I should note that I want to write the program on the mobile, and not on a computer and transfer to the device. It is rather important that I am able to edit portions of the program using the handset, without the need of a desktop computer.
    I found that it is possible to install a python shell on the phone (PyS60) but I don't know if that will allow me to do what I want.
    Another alternative is to write the program in javascript language, save and run in browser, but I feel it may be quite difficult to achieve it.
    Any thoughts?
    Do you have any experience in doing this?

    Try any type of drawing or painting application. You'll find many at VersionTracker or MacUpdate.
    Why reward points?(Quoted from Discussions Terms of Use.)
    The reward system helps to increase community participation. When a community member gives you (or another member) a reward for providing helpful advice or a solution to their question, your accumulated points will increase your status level within the community.
    Members may reward you with 5 points if they deem that your reply is helpful and 10 points if you post a solution to their issue. Likewise, when you mark a reply as Helpful or Solved in your own created topic, you will be awarding the respondent with the same point values.

  • Simple Program for Record/Pla​y Action

    hi,
    i've been trying to make two simple programs (VIs) one with record and the other one with play action vi. but i didn't manage to get it running.
    any suggestions about the usage of Record/Play Action VI?
    thanks
    Message Edited by szemawy on 04-30-2008 01:25 PM

        i managed to get it working
    thx for your help offered anyways
    but the problem is here that the file that's gonna log the nxt's action (movement) -in my case- gonna be long. so i'll try to write my own record/play action VI which will keep the log file on my pc.

  • Im new to the 5g ipod help plz

    will the ipod turn off if i leave it on pause? i know i have a really stupid question but help plz thx

    Yes.

Maybe you are looking for

  • Server 2008R2 - Windows cannot log you on because your profile cannot be loaded

    Hi guys. I have a server SEXXX01 - Windows 2008 R2 OS. Im having major issues to login to this server. This was reveled when a person tried to login to the server and got the error "Cannot log you in, unable to load profile" What we did was to remove

  • Step by step guide to configure 10.8 mail server

    Looking for a decent guide to walk me through configuring the mail server, testing the configuration, etc. plus the obvious DNS and other configuration necessary to make it work and access it from the outside world. Any suggestions?

  • Requirements for few periods not shown in MD04

    PIRs for a materials are not flowing to MD04 list for 04 and 05 periods, it is not showing any PIRs in MD04 though we create requirements in MD62 for these periods, but from 06 onwards it is showing PIRs properly.Can you Please let me know where shou

  • Nokia 208 problems with Opera Mini

    I have a Nokia 208 (Single SIM) and I can not install Opera Mini on him. The application is downloaded but not installed. When I want to install the application, it shows me: "Installing ..." and remains locked so. And after some time it says: "Unabl

  • Getting the variable name

    Hi May be a simple question, but I can't figure out how actually. When I'm doing this var obj:Object = new Object(); obj.test = "My Test"; for(var i:* in obj)      trace(i + " : " + obj[i]);     The output is -> test : My Test My problem comes when I