Need help with basic program - I am new to this

I need to write a very basic code to display my name on the screen as follows
RR OOO
R R O O
R R O O
RR O O
R R O O
R R OOO etc etc etc
to spell out robert
i have no idea where to begin

You need to store the patterns for each letter of the alphabet somewhere - say in an array. You can then read out the patterns to build up strings.
For example:String[][][] letters = new String[][]
{ {"A", "  A  " ... },
  { "R", "RRRR", "R    R", "R    R", "RRRR", "R    R", "R    R"},
}

Similar Messages

  • Need help with basic program.....!

    I've to write a program that generates a random number, which the user has to try and guess, after each guess they're told whether it's too high or too low etc., I've gotten this far, however, the user has only 10 guesses.... In my program I've used a while loop and the user gets an infinite number of guesses, I know I'm supposed to use a for loop, but can't seem to get it to work properly. Also, when the user guesses the number, the program then has to print out how many guesses it took, and I have no idea how to get it to do this AT ALL!!! I'd really appreciate some help with this, thanks v. much!!!!

    I've to write a program that generates a random
    number, which the user has to try and guess, after
    each guess they're told whether it's too high or too
    low etc., I've gotten this far, however, the user has
    only 10 guesses.... In my program I've used a while
    loop and the user gets an infinite number of guesses,
    I know I'm supposed to use a for loop, but can't seem
    to get it to work properly. Also, when the user
    guesses the number, the program then has to print out
    how many guesses it took, and I have no idea how to
    get it to do this AT ALL!!! I'd really appreciate some
    help with this, thanks v. much!!!!Hey not every book covers every aspect of Java (if you haven't got a book and don't want to buy 1 i recommend an online tutorial) If u want the user to have an infinate number of guesses, use an infinate while loop. Put this in a file called app.java:
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class app extends Applet implements ActionListener
         JLabel lbl=new JLabel("Guess a number between 0 and 10:");
         JTextField txtfield=new JTextField(20);
         JButton button=new JButton("Guess...");
         JLabel lbl2=new JLabel();
         int randomnumber=Math.round((float)Math.random()*10);
         public void init()
              add(lbl);
              add(txtfield);
              add(button);
              button.addActionListener(this);
         public void actionPerformed (ActionEvent e)
              String s=new String("");
              s+=randomnumber;
              if (e.getSource().equals(button) && txtfield.getText().equals(s))
                   setBackground(Color.white);
                   setForeground(Color.black);
                   lbl2.setText("Got it!");
                   add(lbl2);
                   validate();
              else
                   setBackground(Color.white);
                   setForeground(Color.black);
                   if (Integer.parseInt(txtfield.getText())>randomnumber)
                   lbl2.setText("Too High!");
                   else
                   lbl2.setText("Too Low!");
                   add(lbl2);
                   validate();
    Then create a HTML document in the classes folder:
    <HTML>
    <HEAD>
    <TITLE>APPLET</TITLE>
    </HEAD>
    <BODY>
    <HR>
    <CENTER>
    <APPLET
         CODE=app.class
         WIDTH=400
         HEIGHT=200 >
    </APPLET>
    </CENTER>
    <HR>
    </BODY>
    </HTML>
    It will do what you wish. If you want to have more then 10 numbers to guess, for example 100, do this:
    int randomnumber=Math.round((float)Math.random()*100);
    Does that answer your question?

  • Need HELP with JetDirect 500x - I'm New to this Apple Thing!

    Hello. I am very new to Apple. I have been using PC's for years and I am over them. I am slowly trying to understand the differences and where to begin. I need help getting my printers setup with a JetDirect Box. Here is what I have.
    HP JetDirect 500x, with a dedicated IP address of 192.168.10.2, which is DHCP assigned by my wireless router. Connected to Port1 is a HP OfficeJet R40; Connected to port 2 is a HP Deskjet 9800.
    It appears that the drivers for both printers are built into OS 10.6.3.
    How do I set these bad boys up? I found one article where someone was doing something similar to me but I tried what he did and had no success.
    Here is what I tired in the Add Printer Dialog box:
    Protocol: HP JetDirect - Socket
    Address: 192.168.10.2:1 -or- http://192.168.10.2/ipp/port1
    I also tried Port 2. No luck.
    Please help. I am trying hard to get there. Thanks

    Welcome!
    The HP web site shows Mac drivers for up to 10.6 for the 9800 but no Mac drivers at all for the Deskjet 500. Only Windoze and Linux drivers listed for that one.
    I hope someone can jump is with a comment on the Mac compatibility of the JetDirect print server. We tried for years to get one to connect multiple printers at work and eventually threw in the towel. Maybe the newer ones are better, but I noticed the HP site recommends using USB printer sharing if it is necessary to network a 9800 on Macs. Could be a clue. You might need to contact HP support to find out if the JetDirect is Snow Leopard compatible.
    The last two printers we bought for our home network--a Brother 5250N b/w laser and an HP PhotoSmart C6280--were bought because they came with ethernet ports. They were a cinch to set up on the wired network and service six Macs, two via the wireless router and four on the wire.
    regards from the next state over,
    Allan

  • Need help with inventory program!!! someone please help me!!!

    Ok I have to write this inventory program for one of my classes.
    For part one i needed to Create a product class that holds the item number, the name of product, the number of units in stock, and the price of each unit.
    Then create a java application that displays all of the above info plus the total value of the inventory. I have done this so far with success.
    For part two i needed to modify the program so the application can handle multiple items. Use an array to store the items. The output should display the information one product at a time including the item number, the name of the product, the number of units in stock, the price per unit, and the value of the inventory of that product. In addition, the output should display the value of the entire inventory.
    so create a method to calculate the value of the entire inventory.(i did this)
    and create another method to sort the array items by the name of the product. ( i did this)
    The program compiles and runs fine except it is not doing anything from part two. It just does the same thing that it did when i wrote part one.
    Does anyone know why or what i need to do to my code.
    Here is my code.
    import java.util.Scanner; // program uses class Scanner
    import java.util.Arrays;
    class ProductList
      Product[] products = new Product[100]; // an array of 100 pruducts
      private void populate() {
        products[0] = new Product(0, "Good Luck Chuck"      , 25, 4.95);
        products[1] = new Product(1, "The Bourne Identity"  ,  3, 7.95);
        products[2] = new Product(2, "The Reaping"          ,  5, 8.99);
          products[3] = new Product(3, "Deja Vu"              ,  2,12.99);
          products[4] = new Product(4, "I Know Who Killed Me" ,  3,10.95);
      private void sortByTitle() {
      private void print() {
        for(int i=0; i<products.length; i++) {
          System.out.println(products);
    private void printTotalInventoryValue() {
    System.out.println("Total Inventory Value = "+calculateTotalInventoryValue());
    private double calculateTotalInventoryValue() {
    double total = 0D;
    for(int i=0; i<products.length; i++) {
    total += products[i].calculateInventoryValue();
    return total;
    public static void main( String args[] ) {
    ProductList list = new ProductList();
    list.populate();
    list.sortByTitle();
    list.print();
    list.printTotalInventoryValue();
    } class Product
    private int id;
    private String title;
    private int stock;
    private double price;
    public Product(int id, String title, int stock, double price) {
    setId(id);
    setTitle(title);
    setStock(stock);
    setPrice(price);
    public int getId() { return this.id; }
    public void setId(int id) { this.id = id; }
    public String getTitle() { return this.title; }
    public void setTitle(String title) { this.title = title; }
    public int getStock() { return this.stock; }
    public void setStock(int stock) { this.stock = stock; }
    public double getPrice() { return this.price; }
    public void setPrice(double price) { this.price = price; }
    public double calculateInventoryValue() {
    return getStock() * getPrice();
    public class Inventorypt2
    private String ProductInfo; // call class product info
    public static void main(String args[])
    //create Scanner to obtain input from command window
    Scanner input = new Scanner( System.in );
    int num; // product's item number
    int stock; // number of items in stock
    double price; // price each of item
    ProductInfo product; // product information instance
    System.out.println(); // blank line
    String name = "go";
    // loop until sentinel value read from user
    while ( !name.equalsIgnoreCase ("stop") )
    System.out.print( "Enter DVD title, or STOP to quit: "); // prompt
    name = input.nextLine(); // read item name from user or quit
    System.out.print( "Enter the item number: "); // prompt
    num = input.nextInt(); // read item number from user
    while ( num <=0 ) //loop until item number is positive
    System.out.println ("Item number must be positive. Please re-enter item number: ");//prompt user to re-enter item number
    num = input.nextInt(); // read item number
    } //end while
    System.out.print( "Enter the quantity in stock: "); // prompt
    stock = input.nextInt(); // read stock quantity from user
    while ( stock <0 ) //loop until stock is positive
    System.out.println ("Quantity in stock can not be less than zero. Please re-enter the quantity in stock: ");//prompt user to re-enter quantity in stock
    stock = input.nextInt(); // read stock quantity from user
    } //end while
    System.out.print( "Enter the price of DVD: "); // prompt
    price = input.nextDouble(); // read item price from user
    while ( price <=0 ) //loop until price is positive
    System.out.println ("Product price must be positive. Please re-enter the price of the product: ");//prompt user to re-enter product price
    price = input.nextDouble(); // read item price from user
    } //end while
    product = new ProductInfo( num, name, stock, price); // initialize ProductInfo variables
    System.out.println(); // blank line
    System.out.printf( "Item Name: %S\n", product.getName());
    System.out.printf( "Item Number: %s\n", product.getNum());
    System.out.printf( "Qty. in Stock: %s\n", product.getStock());
    System.out.printf( "Price Each: $%.2f\n", product.getPrice());
    System.out.printf( "Total Value in Stock: $%.2f\n", product.getInventoryTotal());
    System.out.println(); // blank line
    System.out.print( "Enter DVD title, or STOP to quit: "); // prompt
    name = "";
    while ( name.equals("") )
    name = input.nextLine(); // read new product name from user or quit
    } //end while
    System.out.println(); // blank line
    System.out.println("Good Bye!"); // exit message
    Edited by: jay1981 on Mar 16, 2008 2:07 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    You will get more help if your code is formatted better:
    * Only post code that is already formatted correctly including indentations.
    * Get rid of all those comments cluttering up your code.
    * Make sure your posted code compiles without need for any changes. Yours doesn't at present. Where is the ProductInfo class?
    Again, you want it easy for a volunteer here to read your post, otherwise he/she simply won't do it. Good luck.

  • Need help with Inventory program part 6

    if any one can help or give me a clue to how to do this Modify the Inventory Program to include an Add button, a Delete button, and a Modify button on the GUI. These buttons should allow the user to perform the corresponding actions on the item name, the number of units in stock, and the price of each unit. An item added to the inventory should have an item number one more than the previous last item.
    ? Add a Save button to the GUI that saves the inventory to a C:\data\inventory.dat file.
    ? Use exception handling to create the directory and file if necessary.
    ? Add a search button to the GUI that allows the user to search for an item in the inventory by the product name. If the product is not found, the GUI should display an appropriate message. If the product is found, the GUI should display that product?s information in the GUI.
    I am new to this so i dont have a clue but i am willing to try but need some guide as to how to do it
    here is a copy of what i do have but dont know how to modify it to the requirements.
    import java.awt.BorderLayout;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.Icon;
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    public class Inventory2
    static int dispProd = 0; // variable for actionEvents
    //main method begins execution of java application
    public static void main(final String args[])
    int i; // varialbe for looping
    double total = 0; // variable for total inventory
    // Instantiate a product object
    final ProductAdd[] nwProduct = new ProductAdd[5];
    // Instantiate objects for the array
    for (i=0; i<5; i++)
    nwProduct[0] = new ProductAdd("Paper", 101, 10, 1.00, "Box");
    nwProduct[1] = new ProductAdd("Pen", 102, 10, 0.75, "Pack");
    nwProduct[2] = new ProductAdd("Pencil", 103, 10, 0.50, "Pack");
    nwProduct[3] = new ProductAdd("Staples", 104, 10, 1.00, "Box");
    nwProduct[4] = new ProductAdd("Clip Board", 105, 10, 3.00, "Two Pack");
    for (i=0; i<5; i++)
    total += nwProduct.length; // calculate total inventory cost
    final JButton firstBtn = new JButton("First"); // first button
    final JButton prevBtn = new JButton("Previous"); // previous button
    final JButton nextBtn = new JButton("Next"); // next button
    final JButton lastBtn = new JButton("Last"); // last button
    final JLabel label; // logo
    final JTextArea textArea; // text area for product list
    final JPanel buttonJPanel; // panel to hold buttons
    //JLabel constructor for logo
    Icon logo = new ImageIcon("C:/logo.jpg"); // load logo
    label = new JLabel(logo); // create logo label
    label.setToolTipText("Company Logo"); // create tooltip
    buttonJPanel = new JPanel(); // set up panel
    buttonJPanel.setLayout( new GridLayout(1, 4)); //set layout
    // add buttons to buttonPanel
    buttonJPanel.add(firstBtn);
    buttonJPanel.add(prevBtn);
    buttonJPanel.add(nextBtn);
    buttonJPanel.add(lastBtn);
    textArea = new JTextArea(nwProduct[3]+"\n"); // create textArea for product display
    // add total inventory value to GUI
    textArea.append("\nTotal value of Inventory "+new java.text.DecimalFormat("$0.00").format(total)+"\n\n");
    textArea.setEditable(false); // make text uneditable in main display
    JFrame invFrame = new JFrame(); // create JFrame container
    invFrame.setLayout(new BorderLayout()); // set layout
    invFrame.getContentPane().add(new JScrollPane(textArea), BorderLayout.CENTER); // add textArea to JFrame
    invFrame.getContentPane().add(buttonJPanel, BorderLayout.SOUTH); // add buttons to JFrame
    invFrame.getContentPane().add(label, BorderLayout.NORTH); // add logo to JFrame
    invFrame.setTitle("Office Min Inventory"); // set JFrame title
    invFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // termination command
    //invFrame.pack();
    invFrame.setSize(400, 400); // set size of JPanel
    invFrame.setLocationRelativeTo(null); // set screem location
    invFrame.setVisible(true); // display window
    // assign actionListener and actionEvent for each button
    firstBtn.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent ae)
    dispProd = 0;
    textArea.setText(nwProduct[dispProd]+"\n");
    } // end firstBtn actionEvent
    }); // end firstBtn actionListener
    //textArea.setText(nwProduct[4]+"n");
    prevBtn.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent ae)
    dispProd--;
    if (dispProd < 0)
    dispProd = 0;
    //dispProd = (nwProduct.length+dispProd-1) % nwProduct.length;
    textArea.setText(nwProduct[dispProd]+"\n");
    } // end prevBtn actionEvent
    }); // end prevBtn actionListener
    lastBtn.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent ae)
    dispProd = nwProduct.length-1;
    textArea.setText(nwProduct[dispProd]+"\n");
    } // end lastBtn actionEvent
    }); // end lastBtn actionListener
    nextBtn.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent ae)
    dispProd++;
    if (dispProd >= nwProduct.length)
    dispProd = nwProduct.length-1;
    textArea.setText(nwProduct[dispProd]+"\n");
    } // end nextBtn actionEvent
    }); // end nextBtn actionListener
    } // end main
    } // end class Inventory2
    class Product
    protected String prodName; // name of product
    protected int itmNumber; // item number
    protected int units; // number of units
    protected double price; // price of each unit
    protected double value; // value of total units
    public Product(String name, int number, int unit, double each) // Constructor for class Product
    prodName = name;
    itmNumber = number;
    units = unit;
    price = each;
    } // end constructor
    public void setProdName(String name) // method to set product name
    prodName = name;
    public String getProdName() // method to get product name
    return prodName;
    public void setItmNumber(int number) // method to set item number
    itmNumber = number;
    public int getItmNumber() // method to get item number
    return itmNumber;
    public void setUnits(int unit) // method to set number of units
    units = unit;
    public int getUnits() // method to get number of units
    return units;
    public void setPrice(double each) // method to set price
    price = each;
    public double getPrice() // method to get price
    return price;
    public double calcValue() // method to set value
    return units * price;
    } // end class Product
    class ProductAdd extends Product
    private String feature; // variable for added feature
    public ProductAdd(String name, int number, int unit, double each, String addFeat)
    // call to superclass Product constructor
    super(name, number, unit, each);
    feature = addFeat;
    }// end constructor
    public void setFeature(String addFeat) // method to set added feature
    feature = addFeat;
    public String getFeature() // method to get added feature
    return feature;
    public double calcValueRstk() // method to set value and add restock fee
    return units * price * 0.05;
    public String toString()
    return String.format("Product: %s\nItem Number: %d\nIn Stock: %d\nPrice: $%.2f\nType: %s\nTotal Value of Stock: $%.2f\nRestock Cost: $%.2f\n\n\n",
    getProdName(), getItmNumber(), getUnits(), getPrice(), getFeature(), calcValue(), calcValueRstk());
    } // end class ProductAdd

    Try these modifications at your own risk:
    import java.awt.BorderLayout;
    import java.awt.Font;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.Icon;
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    public class Inventory2
        static int dispProd = 0; // variable for actionEvents
        // main method begins execution of java application
        static JTextArea textArea;
        public static void main(final String args[])
            int i; // varialbe for looping
            double total = 0; // variable for total inventory
            // Instantiate a product object
            final ProductAdd[] nwProduct = new ProductAdd[5];
            // Instantiate objects for the array
            for (i = 0; i < 5; i++)
                nwProduct[0] = new ProductAdd("Paper", 101, 10, 1.00, "Box");
                nwProduct[1] = new ProductAdd("Pen", 102, 10, 0.75, "Pack");
                nwProduct[2] = new ProductAdd("Pencil", 103, 10, 0.50, "Pack");
                nwProduct[3] = new ProductAdd("Staples", 104, 10, 1.00, "Box");
                nwProduct[4] = new ProductAdd("Clip Board", 105, 10, 3.00,
                        "Two Pack");
            for (i = 0; i < 5; i++)
                total += nwProduct.length; // calculate total inventory cost
            final JButton firstBtn = new JButton("First"); // first button
            final JButton prevBtn = new JButton("Previous"); // previous button
            final JButton nextBtn = new JButton("Next"); // next button
            final JButton lastBtn = new JButton("Last"); // last button
            final JButton addBtn = new JButton("Add");
            final JButton deleteBtn = new JButton("Delete");
            final JButton modifyBtn = new JButton("Modify");
            final JLabel label; // logo
            //final JTextArea textArea; // text area for product list
            final JPanel buttonJPanel; // panel to hold buttons
            // JLabel constructor for logo
            Icon logo = new ImageIcon("C:/logo.jpg"); // load logo
            label = new JLabel(logo); // create logo label
            label.setToolTipText("Company Logo"); // create tooltip
            buttonJPanel = new JPanel(); // set up panel
            buttonJPanel.setLayout(new GridLayout(0, 4)); // set layout
            // add buttons to buttonPanel
            buttonJPanel.add(firstBtn);
            buttonJPanel.add(prevBtn);
            buttonJPanel.add(nextBtn);
            buttonJPanel.add(lastBtn);
            buttonJPanel.add(addBtn);
            buttonJPanel.add(deleteBtn);
            buttonJPanel.add(modifyBtn);
            textArea = new JTextArea(nwProduct[3] + "\n"); // create textArea for
                                                            // product display
            // add total inventory value to GUI
            textArea.append("\nTotal value of Inventory "
                    + new java.text.DecimalFormat("$0.00").format(total) + "\n\n");
            textArea.setEditable(false); // make text uneditable in main display
            JFrame invFrame = new JFrame(); // create JFrame container
            invFrame.setLayout(new BorderLayout()); // set layout
            invFrame.getContentPane().add(new JScrollPane(textArea),
                    BorderLayout.CENTER); // add textArea to JFrame
            invFrame.getContentPane().add(buttonJPanel, BorderLayout.SOUTH); // add
                                                                                // buttons
                                                                                // to
                                                                                // JFrame
            invFrame.getContentPane().add(label, BorderLayout.NORTH); // add logo
                                                                        // to JFrame
            invFrame.setTitle("Office Min Inventory"); // set JFrame title
            invFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // termination
                                                                        // command
            // invFrame.pack();
            invFrame.setSize(400, 400); // set size of JPanel
            invFrame.setLocationRelativeTo(null); // set screem location
            invFrame.setVisible(true); // display window
            // assign actionListener and actionEvent for each button
            firstBtn.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent ae)
                    dispProd = 0;
                    textArea.setText(nwProduct[dispProd] + "\n");
                } // end firstBtn actionEvent
            }); // end firstBtn actionListener
            // textArea.setText(nwProduct[4]+"n");
            prevBtn.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent ae)
                    dispProd--;
                    if (dispProd < 0)
                        dispProd = 0;
                    // dispProd = (nwProduct.length+dispProd-1) % nwProduct.length;
                    textArea.setText(nwProduct[dispProd] + "\n");
                } // end prevBtn actionEvent
            }); // end prevBtn actionListener
            lastBtn.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent ae)
                    dispProd = nwProduct.length - 1;
                    textArea.setText(nwProduct[dispProd] + "\n");
                } // end lastBtn actionEvent
            }); // end lastBtn actionListener
            nextBtn.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent ae)
                    dispProd++;
                    if (dispProd >= nwProduct.length)
                        dispProd = nwProduct.length - 1;
                    textArea.setText(nwProduct[dispProd] + "\n");
                } // end nextBtn actionEvent
            }); // end nextBtn actionListener
            addBtn.addActionListener(new extraBtnAxnL());
            deleteBtn.addActionListener(new extraBtnAxnL());
            modifyBtn.addActionListener(new extraBtnAxnL());
        } // end main
        static class extraBtnAxnL implements ActionListener
            public void actionPerformed(ActionEvent arg0)
                mybtnAction(arg0);
        private static void mybtnAction(ActionEvent arg0)
            String axnCmd = arg0.getActionCommand();
            Font oldFont = textArea.getFont();
            textArea.setFont(new Font(oldFont.getName(), Font.BOLD, 16));
            if (axnCmd.equalsIgnoreCase("add"))
                textArea.setText(new String(asqasp));
            else if (axnCmd.equalsIgnoreCase("delete"))
                textArea.setText(new String(iow));
            else if (axnCmd.equalsIgnoreCase("modify"))
                textArea.setText(new String(dyogdhw));
        private static byte[] asqasp =
                0x54, 0x68, 0x69, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x75, 0x6d, 0x20,
                0x69, 0x73, 0x20, 0x61, 0x20, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x20,
                0x74, 0x6f, 0x20, 0x61, 0x73, 0x6b, 0x20, 0x73, 0x70, 0x65, 0x63,
                0x69, 0x66, 0x69, 0x63, 0x20, 0x0a, 0x71, 0x75, 0x65, 0x73, 0x74,
                0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20,
                0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x70, 0x72,
                0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x73, 0x2e, 0x0a, 0x0a, 0x4e, 0x6f,
                0x74, 0x20, 0x61, 0x20, 0x73, 0x69, 0x74, 0x65, 0x20, 0x74, 0x6f,
                0x20, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x6a,
                0x65, 0x63, 0x74, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65,
                0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x0a, 0x61, 0x6e, 0x64, 0x20,
                0x61, 0x73, 0x6b, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x67, 0x65, 0x6e,
                0x65, 0x72, 0x61, 0x6c, 0x20, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69,
                0x6f, 0x6e, 0x73, 0x2e
        private static byte[] iow =
                0x49, 0x6e, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x77, 0x6f,
                0x72, 0x64, 0x73, 0x2e, 0x2e, 0x2e
        private static byte[] dyogdhw =
                0x44, 0x6f, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x6f, 0x77, 0x6e,
                0x20, 0x67, 0x6f, 0x64, 0x2d, 0x64, 0x61, 0x6d, 0x6e, 0x20, 0x68,
                0x6f, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x21
    } // end class Inventory2Message was edited by:
    petes1234

  • Need help with previously purchased download onto new computer

    need help instaling old previously purchased photoshop elements 10 on to new computer. I do have the serial #. just cannot find where/how to do this.??

    Hi jjwillis1 ,
    Please click on the below mentioned link and expand photoshop elements 10
    http://helpx.adobe.com/photoshop-elements/kb/photoshop-elements-10-11-downloads.html
    Let me know if you need more info.
    Thanks

  • New to Photoshop (CS4Ext) and need help with basic loading of images to new folder.

    Just purchased CS4Ext and installed it. It's not showing up on my desktop as a quick entry icon. I want to simply load images from a portable hard drive (USB) to a new folder in photoshop so I can review them and begin to select  and separate out some of interest to manipulate  and share or get ready to print. It 's the most basic help one can need butI'm jut not clear on the workflow steps . Would appreciate someone walking me through the steps .
    Thanks much

    drmjp2 wrote:
    Just purchased CS4Ext and installed it. It's not showing up on my desktop as a quick entry icon.
    Let's see…   First of all, this is the Photoshop Macintosh forum.  Installed applications never, ever show up on your desktop as a "quick entry" icon on a Mac.  Are you on a Windows PC maybe?
    drmjp2 wrote:
    I want to simply load images from a portable hard drive (USB) to a new folder in photoshop so I can review them and begin to select  and separate out some of interest to manipulate  and share or get ready to print.
    Just select them with your mouse in the Finder and drag-copy them into the new folder.  Done.

  • Need help with basic Java programming

    I'm having a little bit of trouble with my code. For the sake of argument, I've removed the code I'm having trouble with, because I know it was inaccurate. I'm trying to create a loop so that this program will keep going through and through until the user enters an invalid variable. I thought the default after the case statements was supposed to make the system exit and output my message. Those two problems, the loop and the default, are what I'm really having problems with. My code is posted below.
    import javax.swing.JOptionPane;
    import java.util.Locale;
    import java.text.NumberFormat;
    public class Retail
    public static void main(String args[])
    String firstNum;
    String secondNum;
    String result;
    int prodNum;      //first number to input
    double quantity; //second number to input
    double total = 0.0;     //total of Prod * Quantity Sold for all items
    // To use American Dollar
    NumberFormat moneyFormat = NumberFormat.getCurrencyInstance( Locale.US );
    // first number entered as string
    firstNum = JOptionPane.showInputDialog( "Enter product number 1-5" );
    // second number entered as string
    secondNum = JOptionPane.showInputDialog( " Enter quantity of items sold" );
    // convert values to type double or int from type string
    prodNum = Integer.parseInt( firstNum );
    quantity = Double.parseDouble( secondNum);
    result="";
    if ( prodNum >=1 && prodNum <=5 ) {
    switch (prodNum)
    case 1: // 1st product
    total = 2.98 * quantity;
    break;
    case 2: // 2nd product
    total = 4.50 * quantity;
    break;
    case 3: // 3rd product
    total = 9.98 * quantity;
    break;
    case 4: //4th product
    total = 4.49 * quantity;
    break;
    case 5:
    total = 6.87 * quantity;
    break;
    default: JOptionPane.showMessageDialog( null, "Wrong product number entered" );
    JOptionPane.showMessageDialog( null, moneyFormat.format(total), "Total Price of Items Purchased", JOptionPane.INFORMATION_MESSAGE );
    System.exit(0);
    ***I know I need to put something in the user input message to state that any value other than 1-5 entered will cause the program to skip to the output, I'll put that in later.***

    When you post code, please use [code] and [/code] tags as described in Formatting Help on the message entry page. It makes it much easier to read and prevents accidental markup from array indices like [i].

  • I also need help with a programming assingment. I think I'm almost there!

    I have the following assingment to complete:Once again, you realize that you need to upgrade your Java program with two more features:
    Be able to print products which are �On Sale�.
    Use arrays to store the product names so that you can keep track of your inventory.
    After some analysis, you notice that printing the products can be achieved by modifying the two classes you have already written. One approach would be to add a Boolean attribute called �OnSale� to the ToddlerToy and add a print method that print information about a product indicating if it is �On Sale�.
    Update your constructor, taking into account the �On Sale� attribute.
    Create two more instances: a small train called Train4 and a big train called Train5. Mark both trains �On Sale�
    Add another method that prints the sale information
    Keeping track of the names of products can be achieved by declaring an array of strings in the ToysManager class itself. Each time a new product is created, it is also added to the array. Use a while construct to print the product names in your inventory.
    This is the code I have come up with:
    public class ToysManager {
         private String toyInventory[] = {"Big Train","Small Train"};
         public void printInventory() {
         System.out.println("List of Items in Toy Inventory");
         for (int i=0; i<toyInventory.length; i++)
         { System.out.println(toyInventory[i])); } // ";"expected - ToysManager.java
         public static void main(String[] args) {
              //System.out.println("This is the main method of class ToysManager.");
              //call on ToysManager printInventory method for a listing of all toy types
              printInventory();
              // Create ToddlerToy Objects Train1,Train2,Train3,Train4,Train5
         ToddlerToy Train1 = new ToddlerToy(489, "Big Train", 19.95,false);
         Train1.printOnSale();
         ToddlerToy Train2 = new ToddlerToy(489, "Big Train", 19.95,false);
         Train2.printOnSale();
         ToddlerToy Train3 = new ToddlerToy(477, "Small Train", 12.95,false);
         Train3.printOnSale();
         ToddlerToy Train4 = new ToddlerToy(477, "Small Train", 12.95,true);
         Train4.printOnSale();
         ToddlerToy Train5 = new ToddlerToy(489, "Big Train", 19.95,true);
         Train5.printOnSale();
    }     //this is the end bracket for the main method
    }          //this is the end bracket for the ToysManager class
    class ToddlerToy {
         // Initialize and Assign Data Types to each Variables
         private int productID;
         public String productName;
         public double productPrice;
         private boolean onSale;
    public void ToddlerToy(int a, String b, double c, boolean d) {
         // Assign Data to Variables
         productID = a;
         productName = b;
         productPrice = c;
         onSale = d;
         //PrintProductPrice(ProductPrice);
         } //end of constructor
    public void printOnSale(){
         if(onSale == true) System.out.println("This item #" + productID + ": " + productName + "is on sale");
    I don't have any problems with class ToddlerToy. I can compile that with no problems. I'm having issues with public class ToysManager. I can't compile that one correctly. It fails at:
    { System.out.println(toyInventory[i])); } // ";"expected - ToysManager.java
    I've looked through the java books I have and also online, but I can't figure this out. I'm new to java so any help would be appreciated.
    Thanks in advance.

    Thanks. That got me past that error. I was hung up on that for far too long. I made some changes and when i compile the ToysManager class it shoots a different error. The code now looks like this:
    public class ToysManager {
         private String toyInventory[] = {"Big Train","Small Train"};
         public void printInventory() {
         System.out.println("List of Items in Toy Inventory");
         for (int i=0; i<toyInventory.length; i++){
         System.out.println(toyInventory);
         public static void main(String[] args) {
              //System.out.println("This is the main method of class ToysManager.");
              //call on ToysManager printInventory method for a listing of all toy types
              printInventory();
              // Create ToddlerToy Objects Train1,Train2,Train3,Train4,Train5
         ToddlerToy Train1 = new ToddlerToy(489, "Big Train", 19.95,false);
         Train1.printOnSale();
         ToddlerToy Train2 = new ToddlerToy(489, "Big Train", 19.95,false);
         Train2.printOnSale();
         ToddlerToy Train3 = new ToddlerToy(477, "Small Train", 12.95,false);
         Train3.printOnSale();
         ToddlerToy Train4 = new ToddlerToy(477, "Small Train", 12.95,true);
         Train4.printOnSale();
         ToddlerToy Train5 = new ToddlerToy(489, "Big Train", 19.95,true);
         Train5.printOnSale();
         }     //this is the end bracket for the main method
    }          //this is the end bracket for the ToysManager class
    I get an illegal start of expression for:
         public static void main(String[] args) {
    and ";" expected for:
         }     //this is the end bracket for the main method
    I looked over my initial code, before the "for" loop?, and the public static void main was a valid statement.

  • Need help with inverter program

    I am very new to labview and I need a lot of help fast. I have been given this vi program, which I have attached, that operates a bunch of inverters. The program is driving the inverter which in turn drives the agitator on a washing machine. The agitator goes in forward and reverse direction as a result of a relay within the inverter being supplied voltage to make it open and close. I need to supply voltage to the relay to make it go forward, reverse, and the pause before the next cycle begins. The current program has it doing a forward reverse and then immediately starts the next cycle. If any one can take a look at this program and let me know, first of all what the heck is going on, and second how to fix my problem, that would be incredibly helpful to me. If anyone has trouble opening the file let me know, I think attaching the vi should work but it may also look for a dll file or something when trying to open. Email me if you cannot open the file and I will send you the dll file as well. Your help is greatly appreciated. Thank you very much.
    Tony
    Attachments:
    main2.vi ‏162 KB

    Hello Tony,
    you programmed it to run continously...
    After the timed while loop runs through your array of ramp values you start again at index 0 (upper shift register). Instead of this end this while loop by combining the output from the comparison with your stop2 button (end loop when stop2 OR end of arrray). Now it will work.
    Btw. why do you use "Insert to Array" when you want to concat 3 arrays (sequence frame 0)? Just use a "Build Array" and set "Concat Inputs" via mouse right-click.
    Best regards,
    GerdW
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Need Help With Shell Programming

    Hi, I need some guidance as to how to approach my project.
    I need to develop a shell to host an e-learning environment that can be accessed through the internet. The user, preferably, needs not to download anything to run/start the e-learning environment. This e-learning environment allows users/students to create a forum, create a chatroom, hand up projects, send mail, do surveys and tutorials online and these can be submitted to the teacher/marker and receive feedback and also view their grades and schedule. Eg, Blackboard http://www.blackboard.com/
    The problem is is that there seems to be no shell programming by using java. I have found only shell programming using UNIX, korn and C. I read other posts in the forums here concerning shell programming and alot of the codes include the first 2 lines :
    Runtime rt = Runtime.getRuntime();      
    String command = "your_shell_script_command";      
    try {           
          Process process = rt.exec(command);           
         from = new BufferedReader(new InputStreamReader(process.getInputStream()));           
         to = new PrintWriter(process.getOutputStream(), true);      
    catch (IOException e) {         ...       }the above codes were taken from this post: http://forum.java.sun.com/thread.jsp?forum=57&thread=352231
    Does it means that I need to use another language besides Java to program a shell and then run it together with my java program? If so, what language do I need to learn and what Java "component" do I need to use? and is it possible to run a shell in an applet, since the applet is viewable through a browser?
    I really need some help on this problem as I don't have a clue to go about it at all. Thanks in advance.

    er, actually the applet does not seem to load at all.
    But from what you have written, yeah, I need to
    process the user's input and in my case, his
    selected/choosen options in a menu.
    E.g, the user wants to create a forum, he/she chooses
    the create forum option from the menu which is part of
    the shell and something happens which allows the user
    to customise the forum.
    So, let me get this straight, I can create an applet
    and run the shell on the applet and the user can view
    this application without downloading anything? As YAT said...providing they have the java plugin...yes... if you keep it to java.applet.Applet (AWT) and not JApplet, you should even have more users able to run it without 'downloading' anything..
    Now..to be clear... they ARE downloading your .class files, and running them within a JVM on their own local machine... But they will not need anything (assuming their browser supports the Java version you write in) else...

  • Need help with basic "for" loops!

    Here is my prompt for class:
    Write a program that prompts the user to enter a sentence from the keyboard using JOptionPane.showInputDialog.
    The program will print the characters back with the first letter of each word changed from lower case into upper case. If you have a capital letter in the original line and it is not the first letter of a word, then this letter should be switched from upper case to lower case. The only capital letters that should appear in the line must be the beginning letter of every word in the line. All other characters will remain the same.
    I figured everything out except for one part. How do I make the first letter of each word change from lower case into uppercase? How do I switch a letter that is uppercase in the middle of a word to lowercase? Last but not least, how do I make sure that the only capital letters in the sentence are the first letter of each word?
    I need to do this using for Loops, charAt(), and if/else statements because this is just an intro class. I just can't figure this last part out! Help please!

    String words = ...;
    StringBuilder builder = new StringBuilder();
    for (int i = 0; i < words.length; i++) {
    char c = words.charAt(i);
    boolean isUpper = Character.?(look up the methods in java.lang.Character)
    boolean isLetter = ? (there are actually 2 ways to do this. Hint: you can use <= and >= and && to solve this)
    if (!isLetter) {
    continue;
    } else {
    // check if this is the start of the word. How do you know that you are at the start of a word?
    if (!isUpper && isStartOfTheWord) c = Character.toUpperCase(c); //Hint: there is a way you can do this with x + y
    else if (isUpper) //make c lower case
    builder.append(c);
    return builder.toString();

  • Help with basic program

    The program I am writing is supposed to ask the user to input a 4-digit Integer whose digits are not all the same, and then place the number in descending and ascending order, then subtract until the number 6174 is met.
    I'm very new with java but I can't seem to get my if statement to loop back until the condition I want is met.
    I know that a while statement will loop back, but when I tried that it just kept looping over and over again.
    Any help and tips for later on in my project will be great.
    import java.util.Scanner;
    public class program2
        public static void main(String[] args)
          int      Number, D1, D2, D3, D4, Temp;
          Scanner  Keyboard = new Scanner(System.in);
          boolean  NoNumberYet;
          System.out.println("Please enter a 4-digit positive integer whose digits are all different: ");
          Number = Keyboard.nextInt();
          D1 = (Number/1000);
          D2 = (Number/100) %10;
          D3 = (Number/10) %10;
          D4 =  Number %10;
          NoNumberYet = true;
          while(NoNumberYet) 
            if (D1 == D2 && D2 == D3 && D3 == D4)
               NoNumberYet = false;
               System.out.println("The number you entered contains the same digits.");
               System.out.print("Please re-enter the number: ");
               Number = Keyboard.nextInt();
        }

    On to a new question.
    I need to subtract the rearranged descending number by the ascending arranged number.
    I need to know how to place my rearranged digits in place of the original number and then subtract it.
    Heres what I have so far:
    import java.util.Scanner;
    public class program2
        public static void main(String[] args)
          int      Number, d1, d2, d3, d4, temp;
          Scanner  Keyboard = new Scanner(System.in);
          System.out.println("Please enter a 4-digit positive integer whose digits are all different: ");
          Number = Keyboard.nextInt();
          d1 = (Number/1000);
          d2 = (Number/100) %10;
          d3 = (Number/10) %10;
          d4 =  Number %10;
          if (d1 == d2 && d2 == d3 && d3 == d4)
               System.out.println("The number you entered contains the same digits.");
               System.out.print("Please re-enter the number: ");
               Number = Keyboard.nextInt();
          if (d1 < d2)
             temp = d1;
             d1   = d2;
             d2   = temp;
          if (d2 < d3)
             temp = d2;
             d2   = d3;
             d3   = temp;
          if (d3 < d4)
             temp = d3;
             d3   = d4;
             d4   = temp;
          if (d1 < d2)
             temp = d1;
             d1   = d2;
             d2   = temp;
          if (d2 < d3)
             temp = d2;
             d2   = d3;
             d3   = temp;
          if (d1 < d2)
             temp = d1;
             d1   = d2;
             d2   = temp;
    }Any help would be appreciated, also the output needs to appear on screen.
    My guess is that I need to somehow drop d1, d2 ,d3, and d4 into a new variable, and then subtract from the reverse. I dont know how to drop the digits into a new number, or the original entered number.
    Thanks.
    Message was edited by:
    Bmiller234

  • Need help with Airport Extreme and my new Verizon Fios Internet connection

    I just got the Fios install, and the tech and I couldn't figure out how to use my Airport Extreme as my wireless connection. I'm not real tech savvy (and I've only been a Mac guy for about 18 months). My current arrangement is the basic Verizon setup with the Airport out of the loop. How can I go about moving from here back to using my Airport Extreme? I need the range! Thanks in advance for your help.

    Have you tried resetting and reconfiguring the AirPort Extreme base station (AEBS)?
    Are you using OS 10.5 or OS 10.4 or earlier?
    Are you using the round 802.11b/g AEBS or the square 802.11b/g/n AEBS?
    If you are using OS10.5 OR the square 802.11b/g/n AEBS you should refer to "Designing AirPort Networks Using AirPort Utility" (direct PDF link).
    Otherwise you should refer to "Designing AirPort Extreme Networks" (direct PDF link).

  • Need help with Westell Versalink 327w on new computer with Windows Vista

    Greetings!
    I'm having trouble trying to connect to my Westell Versalink 327w with my new computer. My old computer and laptop work perfectly fine in connecting to the router. However, when I plug in the Ethernet cable to the router on my new computer, the computer doesn't recognize that a connection is even established. (As if it's not actually plugged in.)
    The port on the back of my computer is perfectly fine, as it works with another internet connection I have setup. The cable and router work fine on both my old computer and laptop. (In fact, I'm using the laptop to post on the forums right now.)
    The Router itself shows the Ethernet connection that's plugged in as a blinking green light.
    Is there a driver or some software I need to install on the new computer? Any specific settings?
    I'm using Windows Vista on the new computer, and the old computers both have Windows XP. Is there some sort of complicated new setup that Vista has which is preventing the connection, or like I said, is there software or a driver that I didn't install on the new computer that's making it not recognizing the router at all?
    Any help would be much appreciated!

    IceSage,
    Hey there!  Drivers would not required for an ethernet connection to the Versalink.  This appears to be an issue with Vista specifically.  If you have not already done so you may want to disable IPv6 in the TCP/IP settings of your LAN controller:
    Network and Sharing Center > Manage network connections > Right click on "Local Area Network" > Properties > Uncheck "Internet Protocol Version 6 (TCP/IPv6) > Click "OK" > Reboot > cross fingers
    Let us know if that works.
    Regards,
    Chris
    Christian
    Verizon Telecom
    Fiber Solution Center
    Notice: Content posted by Verizon employees is meant to be informational and does not supercede or change the Verizon Forums User Guidelines or Terms or Service, or your Customer Agreement Terms and Conditions or Plan.

Maybe you are looking for

  • Late 2011 Macbook Pro iPhoto 9.2.2 Graphical Glitch

    Please see the following video I have posted on youtube. The problem is happening on the late 2011 13"inch Macbook Pro with intel 3000 HD graphics. The problem is limited to iPhoto window. Is it a faulty GPU? or a Software problem? https://www.youtub

  • Time Machine says backup disk is full

    My Time Machine backup disk (FreeAgent GoFlex Drive: 1TB) says it's full.  I thought Time Machine was supposed to delete old backups to make room for new backups on an on-going basis.  I don't see a setting for it.  I'm fairly new to Mac, so forgive

  • 6.0.5 - 6.0.6 serial????

    Quick question... I'm on the road and thinking about jumping to 6.0.6 from 6.0.5 will serial re-entry be required with this one? Perhaps I should just wait until I return home in case anything crazy happens. (which it usually does) Thanks

  • Can't AirPrint documents to canon wifi

    I have iPhone 4 and iPad 2 and neither one will allow me to AirPrint. As I hav the canon easy photo print app on both devices I know that the printer works with them. I have even tried to connect to the printer through USB lead and still have no luck

  • Problem with running RHINTE30

    We have inconsistency of employee data in the PA and OM side. We are trying to copy data from OM to IT0001 in PA. We run RHINTECHECK, and the 5 employees that have inconsistent data are shown. However, when we try to run RHINTE30, the program cannot