Need help..anyone GUI Interfaces

http://forum.java.sun.com/thread.jsp?forum=31&thread=472147&tstart=0&trange=15
Can someone please help me with this program..I'm new to java and I don't understand GUI's. I read everything inside and out in my text book and still don't get how to convert my program into a gui interface...please help.

Sorry i accidently posted twice...
But here is my topic incase the link did not work. Thanks! Really desperate!
Develop a Java application that will determine if a department store customer has exceeded the credit limit on a charge account. For each customer, the following facts are available:
a) Account Balance
b) Balance at the beginning of the month
c) Total of all items charged by this customer this month
d) Total of all credits applied to the customer’s account this month
e) Allowed credit limit
This program should input each of these facts from input dialogs as integers, calculate the new balance, display the new balance and determine if the new balance exceeds the customer’s credit limit. For those customers whose credit limit is exceeded, the program should display the message, “Credit limit exceeded.”
Here is the program I wrote : (for the above criteria)
// Credit.java
// Program monitors accounts
import java.awt.*;
import javax.swing.JOptionPane;
public class Credit {
public static void main( String args[] )
String inputString;
int account, newBalance,
oldBalance, credits, creditLimit, charges;
inputString =
JOptionPane.showInputDialog( "Enter Account (-1 to quit):" );
while ( ( account = Integer.parseInt( inputString ) ) != -1 ) {
inputString =
JOptionPane.showInputDialog( "Enter Balance: " );
oldBalance = Integer.parseInt( inputString );
inputString =
JOptionPane.showInputDialog( "Enter Charges: " );
charges = Integer.parseInt( inputString );
inputString =
JOptionPane.showInputDialog( "Enter Credits: " );
credits = Integer.parseInt( inputString );
inputString =
JOptionPane.showInputDialog( "Enter Credit Limit: " );
creditLimit = Integer.parseInt( inputString );
newBalance = oldBalance + charges - credits;
String resultsString, creditStatusString;
resultsString = "New balance is " + newBalance;
if ( newBalance > creditLimit )
creditStatusString = "CREDIT LIMIT EXCEEDED";
else
creditStatusString = "Credit Report";
JOptionPane.showMessageDialog(
null, resultsString,
creditStatusString,
JOptionPane.INFORMATION_MESSAGE );
inputString =
JOptionPane.showInputDialog( "Enter Account (-1 to quit):" );
System.exit( 0 );
AND I NEED TO MODIFY IT TO DO THE FOLLWOING: (I'M A NEWB AND IT'S TAKEN ME FOREVER JUST TO DO THE ABOVE..PLEASE ANY HELP WOULD BE GREAT!!
Expand the above program.
1) Design an appropriate GUI for input. You cannot use dialog boxes. Design functional window(s) from scratch. State your conditions in the boxed comment at the top of the class. Input will need a transaction date also for the CustomerHistory class.
2) Add a customer # ( a unique identifier)
3) Besides your GUI, you will want 2 other classes: Customer and CustomerHistory. CustomerHistory will serve as a mock database.
4) CustomerHistory will hold the previous balance & allowed credit limit plus any credit violation history. Your CustomerHistory violations must be an array, so that it could be readily expandable.
5) Some step-up is necessary – chose your own approach and document.
6) Then run your system enough times to show the response when a customer exceeds THREE ‘over credit’ limits. CustomerHistory violations should be printed out, as well as, our choice of a ‘dunning notice’. It cannot be the same as a simple one time exceeds limit. Also show a normal customer run. Prove to me your solution works!
7) Draw the UML diagram of your interconnecting classes.

Similar Messages

  • Need help in GUI

    I need help in coding for GUI
    I have created 4 classes which are car, car4sale,dealer and the GUI.
    in dealer class I have created a hash table and I want my data to be stored in this hash table can any one help me plz
    my GUI should be build on text field.
    But I don't know how can I link the GUI to the classes.
    this is the GUI but not complete.
    package Carsale;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    class Button extends JFrame implements ActionListener {
    private JButton button;
    private JTextField textField;
    public static void main(String[] args){
    Button frame = new Button();
    frame.setSize(400,300);
    frame.createGUI();
    frame.show();
    private void createGUI(){
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    Container window = getContentPane();
    window.setLayout(new FlowLayout());
    button = new JButton("VRN");
    window.add(button);
    button.addActionListener(this);
    textField = new JTextField(10);
    window.add(textField);
    public void actionPerformed(ActionEvent event) {
    textField.setText("Button clicked");
    }

    In the future, Swing related questions should be posted in the Swing forum.
    Your question does not have enough information to help you. We can't write a GUI for you. You need to write your own and then ask a specific question when you have a problem.
    Start by reading the [url http://java.sun.com/docs/books/tutorial/uiswing/TOC.html]Swing Tutorial which has lots of examples of creating simple GUIs.
    If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    Don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the posted code retains its original formatting.

  • I need help in GUI

    Hi every one..
    I need help in this class. I want to do a modification to the project AddGUI so that it will do subtraction, multiplication and division of two integre numbers, in addition to addition.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class GUIAddition extends JFrame {
       private String output;
       private int number1, number2, sum;
       private JLabel number1Label, number2Label, sumLabel;
       private JTextField number1TextField, number2TextField;
       private JButton addButton, exitButton;
       private JTextArea textArea;
       public GUIAddition()   {
       super("Sum of Two Integer Numbers");
    // Create an instance of inner class ActionEventHandler
       ActionEventHandler handler = new ActionEventHandler();
    // set up GUI
       Container container = getContentPane();
       container.setLayout( new FlowLayout() );
       // set up Label Fields and Text Fields for number1
       number1Label = new JLabel( "Number1" );
       number1TextField = new JTextField( 10 );
       number1TextField.addActionListener( handler );
       container.add( number1TextField );
       container.add( number1Label );
       // for number2
       number2Label = new JLabel( "Number2" );
       number2TextField = new JTextField( 10 );
       number2TextField.addActionListener( handler );
       container.add( number2TextField );
       container.add( number2Label );
       // for sum
       sumLabel = new JLabel( "Sum" );
       textArea = new JTextArea( 1,10 );  // only output, no addAction
       textArea.setEditable( false );
       container.add( textArea );
       container.add( sumLabel );
       // set up Add Button
       addButton = new JButton( "Add" );
       addButton.addActionListener( handler );
       container.add( addButton );
       // set up Exit Button
       exitButton = new JButton( "Exit" );
       exitButton.addActionListener( handler );
       container.add( exitButton );
      }// end constructor
    // Display The Sum of the Two Numbers in displayfield
       public void displayAddition() {
           textArea.setText(output);
      }// end display method
       public static void main( String args[] )   {
          GUIAddition window = new GUIAddition();
          window.setSize(500, 100);
          window.setVisible( true );
      }// end main
       private class ActionEventHandler implements ActionListener {
         public void actionPerformed(ActionEvent event) {
           // process Text Fields: number1 and number2 as well as Add Button events
           if (event.getSource() == number1TextField)
               number1 = Integer.parseInt(event.getActionCommand());
           else if (event.getSource() == number2TextField)
               number2 = Integer.parseInt(event.getActionCommand());
           else if (event.getSource() == addButton){
                   sum = number1 + number2;
                   output = "" + sum;
                   System.out.println("The Result of adding number1: " + number1 +
                   " and number2: " + number2 + " is: " + sum);
           // process Exit Button event
           else if (event.getSource() == exitButton) System.exit(0);
    // Display Information
           displayAddition();
         } // end method actionPerformed
       }// end inner class ActionEventHandler
    }  // end Class GUIAddition

    I try to do it for subtraction, but it didn't work correctly.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class GUIAddition extends JFrame {
       private String output;
       private int number1, number2, sum, sub;
       private JLabel number1Label, number2Label, sumLabel, subLabel;
       private JTextField number1TextField, number2TextField;
       private JButton addButton, subButton, exitButton;
       private JTextArea textArea;
       public GUIAddition()   {
       super("Sum of Two Integer Numbers");
    // Create an instance of inner class ActionEventHandler
       ActionEventHandler handler = new ActionEventHandler();
    // set up GUI
       Container container = getContentPane();
       container.setLayout( new FlowLayout() );
       // set up Label Fields and Text Fields for number1
       number1Label = new JLabel( "Number1" );
       number1TextField = new JTextField( 10 );
       number1TextField.addActionListener( handler );
       container.add( number1TextField );
       container.add( number1Label );
       // for number2
       number2Label = new JLabel( "Number2" );
       number2TextField = new JTextField( 10 );
       number2TextField.addActionListener( handler );
       container.add( number2TextField );
       container.add( number2Label );
       // for sum
       sumLabel = new JLabel( "Sum" );
       textArea = new JTextArea( 1,10 );  // only output, no addAction
       textArea.setEditable( false );
       container.add( textArea );
       container.add( sumLabel );
       // for sub
       subLabel = new JLabel( "Subtraction" );
       textArea = new JTextArea( 1,10 );  // only output, no addAction
       textArea.setEditable( false );
       container.add( textArea );
       container.add( subLabel );
       // set up Add Button
       addButton = new JButton( "Add" );
       addButton.addActionListener( handler );
       container.add( addButton );
       // set up Sub Button
        subButton = new JButton( "Subtraction" );
       subButton.addActionListener( handler );
       container.add( subButton );
       // set up Exit Button
       exitButton = new JButton( "Exit" );
       exitButton.addActionListener( handler );
       container.add( exitButton );
      }// end constructor
    // Display The Sum of the Two Numbers in displayfield
       public void displayAddition() {
           textArea.setText(output);
      }// end display method
       public static void main( String args[] )   {
          GUIAddition window = new GUIAddition();
          window.setSize(500, 100);
          window.setVisible( true );
      }// end main
       private class ActionEventHandler implements ActionListener {
         public void actionPerformed(ActionEvent event) {
           // process Text Fields: number1 and number2 as well as Add Button events
           if (event.getSource() == number1TextField)
               number1 = Integer.parseInt(event.getActionCommand());
           else if (event.getSource() == number2TextField)
               number2 = Integer.parseInt(event.getActionCommand());
           else if (event.getSource() == addButton){
                   sum = number1 + number2;
                   output = "" + sum;
                   System.out.println("The Result of adding number1: " + number1 +
                   " and number2: " + number2 + " is: " + sum);
           else if (event.getSource() == subButton){
                   sub = number1 - number2;
                   output = "" + sub;
                   System.out.println("The Result of subtraction number1: " + number1 +
                   " and number2: " + number2 + " is: " + sub);
           // process Exit Button event
           else if (event.getSource() == exitButton) System.exit(0);
    // Display Information
           displayAddition();
         } // end method actionPerformed
       }// end inner class ActionEventHandler
    }  // end Class GUIAddition

  • Urgent! Need help in GUI!

    Hi, I am doing a small java project and I am expected to code all the GUI I need in just one class file. Can someone help me? My GUI consists of 2 JButtons, 2 JLabels and 1 JTextField. Also I need to have ActionListener for both of the buttons all in just 1 class file. Anyone please help. It is better if you can provide me with some sample coding to view

    That sounds like a very arbitrarily cooked-up requirement. Homework?
    Assuming your class needs to be a component itself, simply add the buttons, labels and fields into it, typically within the constructor.
    If you mean "one source file" then I would advise using an inner class as your ActionListener; you may even want two. You may like to use anonymous classes which, for instance, call methods in your outer class. All of these solutions will produce more than one class file from the single source file.
    If you really do mean "one class file" then you will need your outer class to implement ActionListener and determine from the getActionCommand() or getSource() methods which of the two buttons the event emanated from. It's a less clean way of going about it, but you get your single class file.
    No sample code - if you need further explanation of the above then just Google for the underlined terms.

  • Need Help with AP Interface and Lockbox

    Been 2 years in SAP and new to US. My company is changing banks . check and ACH transfer to bank.
    I am facing many issues at the place. Really need to understand IDOCS, EDI What format banks accept.How should I go about it?
    All about AP interface. Config and technical design.
    ALso about Lockbox  - BDI, BDI2 formats, other  details config and design.
    Can someone please send me some good material on these two topics. I will really appreciate. My email is
    [email protected]
    Thanks in advance. Points will be awarded.

    Been 2 years in SAP and new to US. My company is changing banks . check and ACH transfer to bank.
    I am facing many issues at the place. Really need to understand IDOCS, EDI What format banks accept.How should I go about it?
    All about AP interface. Config and technical design.
    ALso about Lockbox  - BDI, BDI2 formats, other  details config and design.
    Can someone please send me some good material on these two topics. I will really appreciate. My email is
    [email protected]
    Thanks in advance. Points will be awarded.

  • Need help with GUI lay out HELP PLEASE

    hi iam trying to design this GUI for an assignment i cant seem to post pictures so i uploaded the picture of how its suppose to look
    http://ca.geocities.com/shamtu4life2000/layout.jpg
    i believe i got the code down correct but the layout is messed up also my teacher specified that the open color area be set at 400x300 i believe i did that correct my problem is the layout i get is jumbled and i dont know if i got the open area panel set correctly
    this is my code
    import java.awt.*;
    import javax.swing.*;
    public class colorFrame extends JFrame{
         public colorFrame(){
              //get the content pane of the frame
              //JPanel radio = JPanel();
              Container container = getContentPane();
              //set flowlayout
              container.setLayout(new FlowLayout());
              //create panel p1 set grid
              JPanel p1 = new JPanel();
              p1.setLayout(new GridLayout(1,3)) ;
              //add check boxes
              p1.add(new JCheckBox("RED"));
              p1.add(new JCheckBox("GREEN"));
              p1.add(new JCheckBox("BLUE"));
              //Create panel p2 set grid
              JPanel p2 = new JPanel();
              p2.setLayout (new GridLayout(1,3));
              //Add radio buttons
              p2.add(new JRadioButton("Light"));
              p2.add(new JRadioButton("Normal"));
              p2.add(new JRadioButton("Dark"));
              //Create panel p3
              JPanel p3 = new JPanel();
              p3.setLayout (new GridLayout());
              //add button
              p3.add(new JButton("Show"));
              //Create panel p4
              JPanel p4 = new JPanel();
              p4.setLayout (new GridLayout());
              Dimension d = new Dimension(400,300);
              p4.setPreferredSize(d);
              //Add panels to frame
              container.add(p1, BorderLayout.SOUTH);
              container.add(p2, BorderLayout.SOUTH);
              container.add(p3, BorderLayout.EAST);
              container.add(p4, BorderLayout.NORTH);
         //Main Method
         public static void main(String[] args){
              colorFrame frame = new colorFrame();
              frame.setTitle("Color Frame");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setSize(500,400);
              frame.setVisible(true);
    }if any one got anyideas please let me know below i posted the assignment as background information thanks
    The GUI has a JPanel in the center region that displays different colors. All of the other components (3 JCheckboxes, 3 JRadioButtons, and one JButton) are on a JPanel in the south region of the JFrame. We haven�t yet learned how to make a GUI do anything in response to user generated events, such as mouse clicks. For this question, we just want to practice controlling the appearance of the GUI using layout managers.
    In the constructor of your ColorFrame class, create three JCheckbox objects, three JRadioButtons, and one JButton. All you need to know about these classes is that each
    one has a constructor that takes one String argument:
    new JCheckbox(�Red�)
    new JRadioButton(�Light�)
    new JButton(�Show�)
    We want to use JPanels and layout managers to control the appearance of the GUI. We want the three JCheckboxes to remain together, so we put them on a JPanel. Similarly for the three JRadioButtons � put them on another JPanel. We want the JButton to retain its preferred size � not to grow to fill an entire region of the GUI --so put it on another JPanel.  These JPanels should use FlowLayout.
    We want to put all of these JPanels in the south region of the JFrame, but if we just add them to the frame, one will go on top of the other and we�ll only see the last one that was added. Instead, use one or more additional JPanels with GridLayout to hold the first set of JPanels, then add the JPanels holding all the other components to the JFrame.
    You also want to create another instance of JPanel to add to the center region of the JFrame. Unlike the other JPanels, this one won�t hold other components; it will display different colors. (You don�t have to implement this color display.) When you pack the JFrame, the other JPanels will become large enough to hold the other components they contain, but since this one holds no components, it would shrink to zero by default. To prevent this, you should set its preferred size to some non-zero value, say 400 x 300 pixels.
    Your class should have a main method that calls the constructor tocreate an instance of this class, sets its size using pack, sets its default close operation, and makes it visible.

    You have set the container layout to FlowLayout, but you then try to place panels using the BorderLayout constants, you should use BorderLayout on the container.

  • Oracle 10g installation ora 12154 i really need help anyone

    history: reinstallation, can't pass ora 12154; system windows xp sp2 problem ora 12154
    Destination Folder: L:\oraclexe\
    Port for 'Oracle Database Listener': 1521
    Port for 'Oracle Services for Microsoft Transaction Server': 2030
    Port for HTTP Listener: 8081
    My friend, I believe you created a mess by Installing Oracle 10g Enterprise with your DHCP enable in Windows.
    There are only 2 options if you want to install Oracle 10g Enterprise on Windows.
    1. You install it using Static IP or not connected to network
    2. You install Microsoft Loopback, it is a virtual Network driver and this should be assigned as your primary Network driver instead of your current Network.
    So if you don't want any headache, the easiest way is uninstall your Oracle 10g, disable the DHCP and use static instead, then install again. that will work for sure.
    Don't try to play with the listener and everything because you will get into deeper and deeper problem that end up into frustration :(
    cheers
    Edited by: Chubbyd4d on May 19, 2009 12:58 PM
    Destination Folder: L:\oraclexe\
    Port for 'Oracle Database Listener': 1521
    Port for 'Oracle Services for Microsoft Transaction Server': 2030
    Port for HTTP Listener: 8081
    My friend, I believe you created a mess by Installing Oracle 10g Enterprise with your DHCP enable in Windows.
    There are only 2 options if you want to install Oracle 10g Enterprise on Windows.
    1. You install it using Static IP or not connected to network
    2. You install Microsoft Loopback, it is a virtual Network driver and this should be assigned as your primary Network driver instead of your current Network.
    So if you don't want any headache, the easiest way is uninstall your Oracle 10g, disable the DHCP and use static instead, then install again. that will work for sure.
    Don't try to play with the listener and everything because you will get into deeper and deeper problem that end up into frustration :(
    cheers
    Edited by: Chubbyd4d on May 19, 2009 12:58 PM
    clean start
    ================================================================================================================
    Output generated from configuration assistant "Oracle Net Configuration Assistant":
    Parsing command line arguments:
    Parameter "orahome" = N:\oracle10g
    Parameter "orahnam" = OraDb10g_home1
    Parameter "instype" = typical
    Parameter "inscomp" = client,oraclenet,javavm,server,ano
    Parameter "insprtcl" = tcp,nmp
    Parameter "cfg" = local
    Parameter "authadp" = NO_VALUE
    Parameter "nodeinfo" = NO_VALUE
    Parameter "responsefile" = N:\oracle10g\network\install\netca_typ.rsp
    Done parsing command line arguments.
    Oracle Net Services Configuration:
    Profile configuration complete.
    The information provided for this listener is currently in use by other software on this computer.
    Listener start failed. Listener may already be running.
    Listener configuration complete.
    Default local naming configuration complete.
    Oracle Net Services configuration successful. The exit code is 0
    Configuration assistant "Oracle Net Configuration Assistant" succeeded
    ================================================================================================================
    Output generated from configuration assistant "iSQL*Plus Configuration Assistant":
    iSQL*Plus 10.1.0.2.0
    Copyright (c) 2004 Oracle. All rights reserved.
    Starting iSQL*Plus ...
    iSQL*Plus started.
    Configuration assistant "iSQL*Plus Configuration Assistant" succeeded
    ================================================================================================================
    Output generated from configuration assistant "Oracle Database Configuration Assistant":
    Configuration assistant "Oracle Database Configuration Assistant" failed
    ================================================================================================================
    Output generated from configuration assistant "Oracle Database Configuration Assistant" (attempt 2):
    Configuration assistant "Oracle Database Configuration Assistant" failed
    ================================================================================================================
    Output generated from configuration assistant "Oracle Database Configuration Assistant" (attempt 3):
    Configuration assistant "Oracle Database Configuration Assistant" failed
    install microsoft loop back adapter okay
    ip 10.10.1.1
    255.255.255.0
    still ora 12154
    disable dhcp client on services.msc
    still ora 12154
    pls help
    this is a fresh install
    do i need to remove my oracle 10xe which is perfect working installed on a different drive
    pls help me
    Edited by: oraclehelper on May 20, 2009 1:45 AM

    Destination Folder: L:\oraclexe\
    Port for 'Oracle Database Listener': 1521
    Port for 'Oracle Services for Microsoft Transaction Server': 2030
    Port for HTTP Listener: 8081
    My friend, I believe you created a mess by Installing Oracle 10g Enterprise with your DHCP enable in Windows.
    There are only 2 options if you want to install Oracle 10g Enterprise on Windows.
    1. You install it using Static IP or not connected to network
    2. You install Microsoft Loopback, it is a virtual Network driver and this should be assigned as your primary Network driver instead of your current Network.
    So if you don't want any headache, the easiest way is uninstall your Oracle 10g, disable the DHCP and use static instead, then install again. that will work for sure.
    Don't try to play with the listener and everything because you will get into deeper and deeper problem that end up into frustration :(
    cheers
    Edited by: Chubbyd4d on May 19, 2009 12:58 PM
    Destination Folder: L:\oraclexe\
    Port for 'Oracle Database Listener': 1521
    Port for 'Oracle Services for Microsoft Transaction Server': 2030
    Port for HTTP Listener: 8081
    My friend, I believe you created a mess by Installing Oracle 10g Enterprise with your DHCP enable in Windows.
    There are only 2 options if you want to install Oracle 10g Enterprise on Windows.
    1. You install it using Static IP or not connected to network
    2. You install Microsoft Loopback, it is a virtual Network driver and this should be assigned as your primary Network driver instead of your current Network.
    So if you don't want any headache, the easiest way is uninstall your Oracle 10g, disable the DHCP and use static instead, then install again. that will work for sure.
    Don't try to play with the listener and everything because you will get into deeper and deeper problem that end up into frustration :(
    cheers
    Edited by: Chubbyd4d on May 19, 2009 12:58 PM
    clean start
    ================================================================================================================
    Output generated from configuration assistant "Oracle Net Configuration Assistant":
    Parsing command line arguments:
    Parameter "orahome" = N:\oracle10g
    Parameter "orahnam" = OraDb10g_home1
    Parameter "instype" = typical
    Parameter "inscomp" = client,oraclenet,javavm,server,ano
    Parameter "insprtcl" = tcp,nmp
    Parameter "cfg" = local
    Parameter "authadp" = NO_VALUE
    Parameter "nodeinfo" = NO_VALUE
    Parameter "responsefile" = N:\oracle10g\network\install\netca_typ.rsp
    Done parsing command line arguments.
    Oracle Net Services Configuration:
    Profile configuration complete.
    The information provided for this listener is currently in use by other software on this computer.
    Listener start failed. Listener may already be running.
    Listener configuration complete.
    Default local naming configuration complete.
    Oracle Net Services configuration successful. The exit code is 0
    Configuration assistant "Oracle Net Configuration Assistant" succeeded
    ================================================================================================================
    Output generated from configuration assistant "iSQL*Plus Configuration Assistant":
    iSQL*Plus 10.1.0.2.0
    Copyright (c) 2004 Oracle. All rights reserved.
    Starting iSQL*Plus ...
    iSQL*Plus started.
    Configuration assistant "iSQL*Plus Configuration Assistant" succeeded
    ================================================================================================================
    Output generated from configuration assistant "Oracle Database Configuration Assistant":
    Configuration assistant "Oracle Database Configuration Assistant" failed
    ================================================================================================================
    Output generated from configuration assistant "Oracle Database Configuration Assistant" (attempt 2):
    Configuration assistant "Oracle Database Configuration Assistant" failed
    ================================================================================================================
    Output generated from configuration assistant "Oracle Database Configuration Assistant" (attempt 3):
    Configuration assistant "Oracle Database Configuration Assistant" failed
    install microsoft loop back adapter okay
    ip 10.10.1.1
    255.255.255.0
    still ora 12154
    disable dhcp client on services.msc
    still ora 12154
    pls help
    this is a fresh install
    do i need to remove my oracle 10xe which is perfect working installed on a different drive
    pls help me

  • Need Help With Krono Interface

    If you have exp with Krono Interface Please reply.
    Thanks

    If you have exp with Krono Interface Please reply.
    Thanks

  • Need help with GUI Scripting Audio Midi Setup

    I want to read the value of the sampling frequency set by default in Audio Midi Setup.
    If there is an easy unix way to gleen this, please let me know. Otherwise, I am trying to get it via GUI scripting. I think I am almost there, but am doing something stupid.
    Here is what I have:
    tell application "Audio MIDI Setup"
    activate
    end tell
    tell application "System Events"
    activate
    tell application process "Audio MIDI Setup"
    select window 1
    select group
    select tab group
    select group
    select combo box
    set FrequencyValue to contents of combo box
    end tell
    end tell
    Basically, this comes down to the question of how to extract the default text field from the combo box.

    Once you click on the combo box to get the list of items, you can do stuff with the results. The easiest thing would probably be to use the up and down arrows to change the selection, since the text field is not editable. You can compare the list of items with the current value and do something from there - how do you plan to choose the item to change to?
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #DAFFB6;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    tell application "Audio MIDI Setup" to activate
    tell application "System Events" to tell application process "Audio MIDI Setup"
    set comboBox to combo box 1 of group 1 of tab group 1 of group 1 of window "Audio Devices"
    set frequencyValue to value of comboBox -- get current value
    click button 1 of comboBox -- perform action "AXPress" to drop the list
    set theChoices to value of text fields of list 1 of scroll area 1 of comboBox -- get all the values
    -- keystroke (ASCII character 31) -- down arrow
    -- keystroke (ASCII character 30) -- up arrow
    -- keystroke return -- select and dismiss the list
    end tell
    activate me
    choose from list theChoices default items {frequencyValue} -- just show the results
    </pre>

  • HT201210 I forgot my password,and itunes won't let me restore my ipod. I need help,anyone wanna help me?

     

    Type "unable to restore" into the search bar at the top of this page by Support and read the resulting help articles.

  • Need help with Cisco Interface Cards???/

    Hi, I purchased 4 WIC-1AM cards for my cisco 1760 gateway to use with cisco call manager server. I'm trying to figure out if I can even use these cards for voice cards to make calls inbound and outbound. I'm seing that the cards that CM gives me are all VIC cards listed and i don't see any WIC cards listed in the endpoint list on the CM for the gatway. So can I even use these cards for what I'm trying to do??? Please help???
    Thanks

    If i got the vontage sip account how would i hook it up to my CM Sever?
    I'm using a 1760 gatway, what is a DSP resource?
    When i do show diag I get this from my router:
    show diag
    Slot 0:
    C1760 1FE VE 4SLOT DV Mainboard Port adapter, 3 ports
    Port adapter is analyzed
    Port adapter insertion time unknown
    EEPROM contents at hardware discovery:
    Hardware Revision : 5.0
    PCB Serial Number : FOC08077JDP
    Part Number : 73-7167-05
    Board Revision : B0
    Fab Version : 04
    Product (FRU) Number : CISCO1760
    EEPROM format version 4
    EEPROM contents (hex):
    0x00: 04 FF 40 03 16 41 05 00 C1 8B 46 4F 43 30 38 30
    0x10: 37 37 4A 44 50 82 49 1B FF 05 42 42 30 02 04 FF
    0x20: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    0x30: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    0x40: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    0x50: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    0x60: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    0x70: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    Packet Voice DSP Module Slot 0:
    Not populated
    Packet Voice DSP Module Slot 1:
    Not populated
    WIC/VIC Slot 0:
    One Port Modem WIC
    Hardware revision 1.0 Board revision H0
    Serial number 0034764142 Part number 800-08823-01
    FRU Part Number WIC-1AM=
    Test history 0x00 RMA number 00-00-00
    Connector type WAN Module
    EEPROM format version 1
    EEPROM contents (hex):
    0x20: 01 38 01 00 02 12 75 6E 50 22 77 01 00 00 00 00
    0x30: 88 00 00 00 06 02 10 01 FF FF FF FF FF FF FF FF
    WIC/VIC Slot 1:
    One Port Modem WIC
    Hardware revision 1.0 Board revision H0
    Serial number 0034764050 Part number 800-08823-01
    FRU Part Number WIC-1AM=
    Test history 0x00 RMA number 00-00-00
    Connector type WAN Module
    EEPROM format version 1
    EEPROM contents (hex):
    0x20: 01 38 01 00 02 12 75 12 50 22 77 01 00 00 00 00
    0x30: 88 00 00 00 06 02 10 01 FF FF FF FF FF FF FF FF
    What do you think?

  • Ok guys i need help my ipod touch froze during an update now i put it inot the recovery mode or dfu and it will not reset itself at all it comes up with an error code and says this ipod cannot reset now does anyone have any ideas of what to do with it

    ok guys i need help anyone with my ipod it froze during an update now it will not work at all i ahve put it into the recovery mode or dfu and  it will not reset it self it comes up with an error message 1603 the number is and says the ipod cannot be reset anyone please help me i have tryed everything googled you tubed everything

    Error 1604
    This error is often related to USB timing. Try changing USB ports, using a different dock connector to USB cable, and other available USB troubleshooting steps (troubleshooting USB connections. If you are using a dock, bypass it and connect directly to the white Apple USB dock connector cable. If the issue persists on a known-good computer, the device may need service.
    If the issue is not resolved by USB isolation troubleshooting, and another computer is not available, try these steps to resolve the issue:
    Connect the device to iTunes, confirm that the device is in Recovery Mode. If it's not in Recovery Mode,put it into Recovery Mode.
    Restore and wait for the error.
    When prompted, click OK.
    Close and reopen iTunes while the device remains connected.
    The device should now be recognized in Recovery Mode again.
    Try to restore again.
    If the steps above do not resolve the issue, try restoring using a known-good USB cable, computer, and network connection.
    Error 1600, 1601, 1602
    Error 1603
    Follow the steps listed above for Error 1604. Also, discard the .ipsw file, open iTunes and attempt to download the update again. See the steps under Advanced Steps > Rename, move, or delete the iOS software file (.ipsw) below for file locations.If you do not want to remove the IPSW in the original user, try restoring in a new administrator user. If the issue remains, Eliminate third-party security software conflicts.

  • I Need Help as I'm a beginner in Creative Cloud

    I can't download Lightroom 5 after purchasing it. I need help, anyone please?

    Vanicci please see Install and update apps - https://helpx.adobe.com/creative-cloud/help/install-apps.html for information on how to install Photoshop Lightroom or any other Adobe Creative applications included with your membership.

  • Need help!!!! GUI problems with netbeans

    i have a problem with the interface i created using netbeans.
    i created a JFrame, inside it a JDesktopPane, and inside that 3 JInternalFrames. the problem is in one of the JinternalFrames, i have 4 radio buttons which i forgot to add to a buttongroup and whenever i try to do that, the GUI doesn't work anymore. The bigger problem is that if i undo the changes, the thing still doesn't work and i have to copy my backup project folder over the one i work on to get an output.
    i tried to edit the source code to add the 4 buttons to a button group but netbeans won't let me since i created the buttons thru it not by writing it myself
    please i really need help with this and i hope its a stupid thing i'm just overlooking.
    If u need the code, i will gladly post it.
    thanks in advance

    if you're not using a netbeans-specific layout manager, copy the working code
    into notepad, make the changes, then compile and run from the command prompt.
    if all works OK, dump netbeans

  • I'm writing a mazerace game...I need help from a Java Pro regarding GUI

    I've tested my code using a textUI, but not successful with GUI.
    Following are the files I have at present but are incomplete...someone please assist me, let me know what I'm missing to run the program successfully in a window.
    All I need to do is to bring the maze (2D array) onto a window, and listen to the keys (A,S,D,W & J,K,L,I) and make the move accordingly (using the move method in the MazeRace Class)
    This is my class - MazeRace
    import javax.swing.*;
    import java.io.*;
    * This class is responsible for:
    * -Initializes instance variables used to store the current state of the game
    * -When a player moves it checks if the move is legal
    * and updates the state of the game if move is allowable and made
    * -Reports information about current state of the game when asked:
    * o whether game has been won
    * o how many moves have been made by a given player
    * o what is the current configuration of the maze, etc.
    public class MazeRace {
    /** The Maze Race layout */
    private static char[][] mazeLayout;
    /** Dimensions of the maze */
    //private static final int rowLength = mazeLayout.length;
    //private static final int columnLength = mazeLayout[0].length;
    /** space in the grid is a wall */
    private static final char wall = 'X';
    /** space in the grid has been used */
    private static final char spaceUsed = '.';
    /** space in the grid is available */
    private static final char spaceAvailable = ' ';
    /** Character for Charles, Ada & Goal*/
    private static final char CHARLES = 'C';
    private static final char ADA = 'A';
    private static final char GOAL = 'G';
    /** Location of Goal in the Maze */
    private static int rowGoal = 0;
    private static int columnGoal = 0;
    /** Location of Ada in the Maze */
    private static int rowAda = 0;
    private static int columnAda = 0;
    /** Location of Charles in the Maze */
    private static int rowCharles = 0;
    private static int columnCharles = 0;
    /** Number of Ada's moves */
    private static int countAdasMoves = 0;
    /** Number of Charles's moves */
    private static int countCharlesMoves = 0;
    * Constructor for MazeRace
    * &param mazeGrid - 2D array of characters
    public MazeRace(char[][] mazeGrid){
    this.mazeLayout = mazeGrid;
    for (int row = 0; row < mazeLayout.length; row++){
    for (int column = 0; column < mazeLayout[0].length; column++){
    if (mazeLayout[row][column] == GOAL){
    this.rowGoal = row;
    this.columnGoal = column;
    if (mazeLayout[row][column] == ADA){
    this.rowAda = row;
    this.columnAda = column;
    if (mazeLayout[row][column] == CHARLES){
    this.rowCharles = row;
    this.columnCharles = column;
    public boolean canMoveLeft(){
    int rowA = this.rowAda;
    int columnA = this.columnAda;
    int rowC = this.rowCharles;
    int columnC = this.rowCharles;
    boolean canMove = false;
    if (mazeLayout[rowA][columnA - 1] == spaceAvailable
    || mazeLayout[rowA][columnA - 1] == GOAL) {
    canMove = true;
    return canMove;
    * This method takes in a single character value that indicates
    * both the player making the move, and which direction the move is in.
    * If move is legal, the player's position will be updated. Move is legal
    * if player can move one space in that direction i.e. the player isn't
    * moving out of the maze, into a wall or a space has already been used.
    * @param moveDirection: indicates the player making the move and direction
    * @return moveMade: boolean value true if move was made, false otherwise
    public boolean move(char move){
    boolean validMove = false;
    /** store Ada's current row location in a temp variable */
    int rowA = this.rowAda;
    /** store Ada's current column location in a temp variable */
    int columnA = this.columnAda;
    /** store Charles current row location in a temp variable */
    int rowC = this.rowCharles;
    /** store Charles current column location in a temp variable */
    int columnC = this.columnCharles;
    /** if Ada is moving left, check if she can make a move */
    if (move == 'A' && (mazeLayout[rowA][columnA - 1] == spaceAvailable
    || mazeLayout[rowA][columnA - 1] == GOAL)) {
    /** if move is legal, then update old space to spaceUsed '.' */
    mazeLayout[rowA][columnA] = spaceUsed;
    /** update Ada's new position */
    mazeLayout[rowA][columnA - 1] = ADA;
    this.rowAda = rowA; //update new row location of Ada
    this.columnAda = columnA - 1; //update new column location of Ada
    validMove = true; //valid move has been made
    countAdasMoves++; //increment Ada's legal move
    /** if Ada is moving down, then check if she can make the move */
    if (move == 'S'&& (mazeLayout[rowA + 1][columnA] == spaceAvailable
    || mazeLayout[rowA + 1][columnA] == GOAL)) {
    mazeLayout[rowA][columnA] = spaceUsed;
    mazeLayout[rowA + 1][columnA] = ADA;
    this.rowAda = rowA + 1;
    this.columnAda = columnA;
    validMove = true;
    countAdasMoves++;
    /** if Ada is moving right, then check if she can make the move */
    if (move == 'D'&& (mazeLayout[rowA][columnA + 1] == spaceAvailable
    || mazeLayout[rowA][columnA + 1] == GOAL)) {
    mazeLayout[rowA][columnA] = spaceUsed;
    mazeLayout[rowA][columnA + 1] = ADA;
    this.rowAda = rowA;
    this.columnAda = columnA + 1;
    validMove = true;
    countAdasMoves++;
    /** if Ada is moving up, then check if she can make the move */
    if (move == 'W'&& (mazeLayout[rowA - 1][columnA] == spaceAvailable
    || mazeLayout[rowA - 1][columnA] == GOAL)) {
    mazeLayout[rowA][columnA] = spaceUsed;
    mazeLayout[rowA - 1][columnA] = ADA;
    this.rowAda = rowA - 1;
    this.columnAda = columnA;
    validMove = true;
    countAdasMoves++;
    /** if Charles is moving left, then check if he can make the move */
    if (move == 'J'&& (mazeLayout[rowC][columnC - 1] == spaceAvailable
    || mazeLayout[rowC][columnC - 1] == GOAL)) {
    mazeLayout[rowC][columnC] = spaceUsed;
    mazeLayout[rowC][columnC -1] = CHARLES;
    this.rowCharles = rowC;
    this.columnCharles = columnC - 1;
    validMove = true;
    countCharlesMoves++;
    /** if Charles is moving down, then check if he can make the move */
    if (move == 'K'&& (mazeLayout[rowC + 1][columnC] == spaceAvailable
    || mazeLayout[rowC + 1][columnC] == GOAL)) {
    mazeLayout[rowC][columnC] = spaceUsed;
    mazeLayout[rowC + 1][columnC] = CHARLES;
    this.rowCharles = rowC + 1;
    this.columnCharles = columnC;
    validMove = true;
    countCharlesMoves++;
    /** if Charles is moving right, then check if he can make the move */
    if (move == 'L'&& (mazeLayout[rowC][columnC + 1] == spaceAvailable
    || mazeLayout[rowC][columnC + 1] == GOAL)) {
    mazeLayout[rowC][columnC] = spaceUsed;
    mazeLayout[rowC][columnC + 1] = CHARLES;
    this.rowCharles = rowC;
    this.columnCharles = columnC + 1;
    validMove = true;
    countCharlesMoves++;
    /** if Charles is moving up, then check if he can make the move */
    if (move == 'I'&& (mazeLayout[rowC - 1][columnC] == spaceAvailable
    || mazeLayout[rowC - 1][columnC] == GOAL)){
    mazeLayout[rowC][columnC] = spaceUsed;
    mazeLayout[rowC - 1][columnC] = CHARLES;
    this.rowCharles = rowC - 1;
    this.columnCharles = columnC;
    validMove = true;
    countCharlesMoves++;
    return validMove;
    * This method indicates whether the current maze configuration is a winning
    * configuration for either player or not.
    * Return 1 if Ada won
    * Return 2 if Charles won
    * Return 0 if neither won
    * @return int won: Indicates who won the game (1 or 2) or no one won the
    * game (0)
    public static int hasWon() {
    int won = 0;
    /** if location of Goal's row and column equals Ada's then she won */
    if (rowGoal == rowAda && columnGoal == columnAda){
    won = 1;
    /** if location of Goal's row and column equals Charles's then he won */
    if (rowGoal == rowCharles && columnGoal == columnCharles){
    won = 2;
    /** if both players are away from the Goal then no one won */
    if ((rowGoal != rowAda && columnGoal != columnAda) &&
    (rowGoal != rowCharles && columnGoal != columnCharles)) {
    won = 0;
    return won;
    * This method indicates whether in the current maze configuration both
    * players are caught in dead ends.
    * @return deadEnd: boolean value true if both players can't make a valid
    * move, false otherwise
    public static boolean isBlocked(){
    boolean deadEnd = false;
    /** Check if Ada & Charles are blocked */
    if (((mazeLayout[rowAda][columnAda - 1] == wall
    || mazeLayout[rowAda][columnAda - 1] == spaceUsed
    || mazeLayout[rowAda][columnAda - 1] == CHARLES)
    && (mazeLayout[rowAda][columnAda + 1] == wall
    || mazeLayout[rowAda][columnAda + 1] == spaceUsed
    || mazeLayout[rowAda][columnAda + 1] == CHARLES)
    && (mazeLayout[rowAda + 1][columnAda] == wall
    || mazeLayout[rowAda + 1][columnAda] == spaceUsed
    || mazeLayout[rowAda + 1][columnAda] == CHARLES)
    && (mazeLayout[rowAda - 1][columnAda] == wall
    || mazeLayout[rowAda - 1][columnAda] == spaceUsed
    || mazeLayout[rowAda - 1][columnAda] == CHARLES))
    && ((mazeLayout[rowCharles][columnCharles - 1] == wall
    || mazeLayout[rowCharles][columnCharles - 1] == spaceUsed
    || mazeLayout[rowCharles][columnCharles - 1] == ADA)
    && (mazeLayout[rowCharles][columnCharles + 1] == wall
    || mazeLayout[rowCharles][columnCharles + 1] == spaceUsed
    || mazeLayout[rowCharles][columnCharles + 1] == ADA)
    && (mazeLayout[rowCharles + 1][columnCharles] == wall
    || mazeLayout[rowCharles + 1][columnCharles] == spaceUsed
    || mazeLayout[rowCharles + 1][columnCharles] == ADA)
    && (mazeLayout[rowCharles - 1][columnCharles] == wall
    || mazeLayout[rowCharles - 1][columnCharles] == spaceUsed
    || mazeLayout[rowCharles - 1][columnCharles] == ADA))) {
    deadEnd = true;
    return deadEnd;
    * This method returns an integer that represents the number of moves Ada
    * has made so far. Only legal moves are counted.
    * @return int numberOfAdasMoves: number of moves Ada has made so far
    public static int numAdaMoves() {
    return countAdasMoves;
    * This method returns an integer that represents the number of moves Charles
    * has made so far. Only legal moves are counted.
    * @return int numberOfCharlesMoves: number of moves Charles has made so far
    public static int numCharlesMoves() {
    return countCharlesMoves;
    * This method returns a 2D array of characters that represents the current
    * configuration of the maze
    * @return mazeLayout: 2D array that represents the current configuration
    * of the maze
    public static char[][] getGrid() {
    return mazeLayout;
    * This method compares contents of this MazeRace object to given MazeRace.
    * The two will not match if:
    * o the two grids have different dimensions
    * o the two grids have the same dimensios but positions of walls, players or
    * goal differs.
    * @param MazeRace: MazeRace object is passed in and compared with the given
    * MazeRace grid
    * @return boolean mazeEqual: true if both grids are same, false otherwise
    public static boolean equals(char[][] mr) {
    boolean mazeEqual = true;
    /** If the length of the arrays differs, then they are not equal */
    if (mr.length != mazeLayout.length || mr[0].length != mazeLayout[0].length){
    mazeEqual = false;
    } else {
    /** If lengths are same, then compare every element of the array to other */
    int count = 0;
    int row = 0;
    int column = 0;
    while( count < mr.length && mazeEqual) {
    if( mr[row][column] != mazeLayout[row][column]) {
    mazeEqual = false;
    count = count + 1;
    row = row + 1;
    column = column + 1;
    return mazeEqual;
    * This method represents the current state of the maze in a string form
    * @return string mazeString: string representation of the maze configuration
    public String toString() {
    String mazeString = "";
    for (int row = 0; row < mazeLayout.length; row++){
    for (int column = 0; column < mazeLayout[0].length; column++){
    mazeString = mazeString + mazeLayout[row][column];
    mazeString = mazeString + "\n";
    return mazeString.trim();
    The following is the Driver class: MazeRaceDriver
    import javax.swing.*;
    import java.io.*;
    * This class is the starting point for the maze race game. It is invoked
    * from the command line, along with the location of the layout file and
    * the desired interface type. Its main purpose is to initialize the
    * components needed for the game and the specified interface.
    public class MazeRaceDriver {
    * A method that takes a text file representation of the maze and
    * produces a 2D array of characters to represent the same maze.
    * @param layoutFileName location of the file with the maze layout
    * @return The maze layout.
    public static char[][] getLayoutFromFile( String layoutFileName )
    throws IOException {
    BufferedReader br = new BufferedReader(new FileReader(layoutFileName));
    String s = br.readLine();
    int r = 0; // start at row 1
    int c = s.length(); // initialize column to the length of the string
    while(s != null){
    r++;
    s = br.readLine();
    char[][]grid = new char[r][c];
    // this part, gets the text file into a char array
    BufferedReader brr = new BufferedReader(new FileReader(layoutFileName));
    String ss = brr.readLine();
    int row = 0;
    while(ss != null){
    for(int col = 0; col < c; col++){
    grid[row][col] = ss.charAt(col);
    row++;
    ss = brr.readLine();
    return grid;
    * The main method of your program.
    * @param args command-line arguments provided by the user
    public static void main( String[] args ) throws IOException {
    // check for too few or too many command line arguments
    if ( args.length != 2 ) {
    System.out.println( "Usage: " +
    "java MazeRaceDriver <location> <interface type>" );
    return;
    if ( args[1].toLowerCase().equals( "text" ) ) {
    char[][] layout = getLayoutFromFile( args[0] );
    MazeRace maze = new MazeRace( layout );
    MazeRaceTextUI game = new MazeRaceTextUI( maze );
    game.startGame();
    else if ( args[1].toLowerCase().equals( "gui" ) ) {
    // Get the filename using a JFileChooser
    // read the layout from the file
    // starting the window-based maze game
    JFileChooser chooser = new JFileChooser("");
    int returnVal = chooser.showOpenDialog(null);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
    BufferedReader br =
    new BufferedReader(new FileReader(chooser.getSelectedFile()));
    String inputLine = br.readLine();
    while (inputLine != null) {
    System.out.println(inputLine);
    inputLine = br.readLine();
    char[][] layout = getLayoutFromFile( args[0] );
    MazeRace maze = new MazeRace( layout );
    MazeRaceWindow game = new MazeRaceWindow( maze );
    game.startGame();
    } else {
    System.out.println("Cancel was selected");
    } else {
    System.out.println( "Invalid interface for game." +
    " Please use either TEXT or GUI." );
    return;
    The following is the MazeRaceWindow class
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.io.*;
    * This class is responsible for displaying the maze race game. It should
    * set up the maze window when the game is started and update the display
    * with each move.
    public class MazeRaceWindow extends JFrame {
    private JLabel[][] mazeLabel;
    private JFrame mazeFrame;
    * Reference to the underlying MazeRace object which needs to be
    * updated when either player moves
    private MazeRace maze;
    * Class constructor for the GUI object
    * @param maze the underlying MazeRace object
    public MazeRaceWindow( MazeRace maze ) {
    this.maze = maze;
    System.out.println(maze);
    mazeFrame = new JFrame();
    mazeFrame.setSize(200,200);
    Container content = mazeFrame.getContentPane();
    System.out.println(content);
    content.setLayout(new GridLayout(.length, mazeLayout[0].Length));
    for (int i = 0; i < MazeRace.length; i++ ) {
    for (int j = 0; j < MazeRace[0].length; j++ ) {
    mazeLabel = new JLabel[MazeRace.rowLength][MazeRace.columnLength];
    content.add(mazeLabel[i][j]);
    System.out.println(mazeLabel[i][j]);
    mazeFrame.pack();
    mazeFrame.setVisible(true);
    //content.add(mazeLabel);
    //mazeFrame.addKeyListener(this);
    * A method to be called to get the game running.
    public void startGame() throws IOException {
    System.out.println();
    /* loop to continue to accept moves as long as there is at least one
    * player able to move and no one has won yet
    while ( !maze.isBlocked() && maze.hasWon() == 0 ) {
    // prints out current state of maze
    System.out.println( maze.toString() );
    System.out.println();
    // gets next move from players
    System.out.println("Next move?");
    System.out.print("> ");
    BufferedReader buffer =
    new BufferedReader( new InputStreamReader( System.in ) );
    String moveText = "";
    moveText = buffer.readLine();
    System.out.println();
    // note that even if a string of more than one character is entered,
    // only the first character is used
    if ( moveText.length() >= 1 ) {
    char move = moveText.charAt( 0 );
    boolean validMove = maze.move( move );
    // The game has finished, so we output the final state of the maze, and
    // a message describing the outcome.
    System.out.println( maze );
    int status = maze.hasWon();
    if ( status == 1 ) {
    System.out.println( "Congratulations Ada! You won the maze in "
    + maze.numAdaMoves() + " moves!" );
    } else if ( status == 2 ) {
    System.out.println( "Congratulations Charles! You won the maze in "
    + maze.numCharlesMoves() + " moves!" );
    } else {
    System.out.println( "Stalemate! Both players are stuck. "
    + "Better luck next time." );
    The following is the Listener class: MazeRaceListener
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    /** Listens for keystrokes from the GUI interface to the MazeRace game. */
    public class MazeRaceListener extends KeyAdapter {
    * Reference to the underlying MazeRace object which needs to be updated
    * when either player moves
    private MazeRace maze;
    * Reference to the MazeRaceWindow object that displays the state of
    * the game
    private MazeRaceWindow mazeWindow;
    * Class constructor for the key listener object
    * @param maze the underlying MazeRace object
    public MazeRaceListener( MazeRace maze ) {
    this.maze = maze;
    * A method that sets which JFrame will display the game and need to be
    * updated with each move.
    * @param window the JFrame object that displays the state of the game
    public void setMazeRaceWindow( MazeRaceWindow window ) {
    mazeWindow = window;
    * A method that will be called each time a key is pressed on the active
    * game display JFrame.
    * @param event contains the pertinent information about the keyboard
    * event
    public void keyTyped( KeyEvent event ) {
    char move = event.getKeyChar();
    // TODO: complete method so that the appropriate action is taken
    // in the game
    //mazeLabel.setText(String.valueOf(move).toUpperCase());
    }

    and listen to the keys (A,S,D,W & J,K,L,I) and make the move accordingly [url http://java.sun.com/docs/books/tutorial/uiswing/misc/keybinding.html]How to Use Key Bindings

Maybe you are looking for

  • Problem in sending mail through dynamics actions

    Hi Friends, I have a problem in sending mail through dynamics actions . In this  we pass a subroutine in dynamics actions which send an mail when promotion action occured. Problem is that sometimes it will  send an mail or sometimes not. I have no id

  • Exact location for this patch is required

    hi i required exact location for this patch Black down JRE 1.1.8 v3 thankyou

  • Custom edit forms for XMLForms

    Using XML Forms in EP 6.0 SP9, I've created a default edit form and another custom edit form. The idea is that users will only see the default edit form, while content administrators will be able to see the more detailed custom edit form. I've notice

  • Chart digital display format keeps changing

    I am running Labview 8.5.1 on windows XP. My digital display for my chart keeps changing to %.2f format when I run the VI. I tried setting the display format to scientific but as soon as I run the VI, it changes back to floating point. I have include

  • Please help me find a good MP3 tagger for Mac

    I have switched to Mac. I am now organizing my music properly, with Lyrics, Art, genre's, etc. iTunes does a good job at some things for tagging but not others. I used to use some good apps on Win XP but they dont work on Mac. Can someone recommend g