Need help with buttons in a phone simulation

Hello
I have built a telephone interface to be used for training in a Call Center.
I am attempting to allow the user to press on the numberpad to enter passwords and such.
It is only a simulation and will only work if the user presses the correct buttons.
I am able to create the simulation when the user presses different buttons such as 1234
but I need them to press 0000 (zero 4 times)
I am not sure how to do this...
I have been playing around with the advanced actions, which has allowed me to accomplish the hide and show actions when the user clicks a button, but wondering if there is a way I can
have them click the 0 on the dialpad so each time it brings up the next zero
once its gets to the 4th one, it will advance to the next slide...
Hope that makes sense
I appreciate any help or advice
thanks
Melissa

Hi there,
What I did, I took a variable 'counter123' and assign '0' value to this variable.
I then added a button with Advanced action, I am sharing the Screenshot of the advanced action panel.
Screen shot 1 :
Incrementing the Value on click :
The value of the variable should increase on every click, so lets add a true statement as a condition.
Screenshot no 2 :
As normally on buttons/click boxes, the project will continue as soon we click them.
lets compare the value of our variable and then pause the project.
Screen shot 3 :
last if our purpose is solved, here we have clicked the button 4 times, so that has updated the value of our counter to 4, so as soon as the counter exceeds the value, we want the project to continue.
please let me know if this helps you.
This will help you in pressing a button 4 times, and i think you can also add actions to show and hide 'zeros' in your project.
I find such scenarios very interesting and I always find help on Lilybiri's Blog : http://lilybiri.posterous.com/
Thanks

Similar Messages

  • Need help with deciding on witch phone to get

    Need some help with figuring out what phone to get? I’ am set on getting the DroidX and my wife wants the Droid 2. So here is my question? The Droid 2 is showing it can expand out to 40Gig has a drop down keyboard ect but what I don’t see is that it can do GPS.
    Can the DroidX memory be expanded bigger the 16 gig. I have lot of questions just need some answers
    Thanks

    Big_Ron wrote:
    I would love to go play with one. But I’m currently deployed  over sea’s with the Navy right now due to come home back to the states in a few months and I’m looking for a new phone, the one’s in Japan suck and so does the service. Can’t wait for an American phone. I compared both phones on the version website and it shoed the Droid x to support VZ navigator. And it showed the Droid 2 to be expandable to 40 gig. My wife wants the keyboard I personally don’t like the drop down keyboard. Is there any thing else you all can tell me every body has been extremely helpfully. But at this point it looks like I’m going with the droid X and my wife will be getting the Droid 2. What about sound, camera is the touch screen accurate?   
    Thank you for serving the U.S. Navy!
    I hope you do enjoy the new Droid X and your wife enjoys the Droid 2. Remember this....you both have 30 days to try out the phone. If you don't like for whatever reason or something is wrong with it just exchange it. This is nice because you can pretty much test out the phone & see if it meets your needs/wants.  Not sure about the sound or camera. For touch screen I have read it is pretty responsive. Have you ever owned a touch screen before? If not it may take a little time to warm up to the touch screen part. Just remember, practice makes perfect for typing on the touch screen and other things. I  think the Droid X has swype built into it which makes it easier to type on

  • Need help with synching 2 different phones.

    Hello I have a N82 and a 6085. In a nutshell I want to have the same information (contacts with numbers and aaddresses) on both phones. What confuses me is the difference between synching with the nokia synch application,Microsoft Outlook, and Nokia Communication center.
    I only recently found out that you can't save addresses on the SIM card, it has to be on the phone memory. What I also didn't know is if you have the names and adresses in the phone memory and on the SIM and you don't select Phone or SIM only the phone displays both. I was wondering why I had so many duplicate entries.
    OK but back to the main problem. Where does Nokia Communication Center get it's list from? How about regular Synch? 

    Try to directly transfer from 6085 to N82. To do this, turn on the Bluetooth of both phones and make sure that the 6085 is set to Visible to all. Then start:
    Tools > Utilities > Switch
    Folow the steps. Basically it will ask what sync you want, so select Download (the middle button in case the Wizard does not start). 
    If you want to use computer, then Syncing is not you need. You need to use Content Copier. Start it and make a backup of the 6085. Then connect the Nokia N82 and use Restore, choosing the backup file of the 6085.
    Message Edited by kamenlitchev on 24-Jan-2009 04:32 PM
    Ericsson T10i -> Nokia 7110 -> Siemens C45, C55, M55, M65 -> Nokia 6131, N73, N82 -> HTC Wildfire, Desire HD -> Nokia Lumia 800 -> HTC Desire X -> Lumia 820 -> Sony Xperia SP -> Lumia 925 + Sennheiser CX 500
    If I've helped, use the Kudos button to thank

  • Need help with buttons that react to rollover that create a scoll effect

    hey everyone,
    I'm new to flash and actionscript and am having trouble
    creating what I need. I want to create a scroll area that scrolls
    left and right when you rollover a left or right arrow. what I want
    to scroll looks like a piece of film negative that has about 20
    thumbnails in it. I only want it to show about 4 thumbs at once
    though (thus the scroll is needed). so when the mouse rolls over
    the arrows, it scrolls, and when it rolls out it stops in place.
    eventually, i will add links to the thumbs for a better image.
    I've checked out a couple tutorials on scrollbars and such
    thinking that I can just go in and modify the code a bit, but the
    two turorials i've tried to do have left some of the pieces out...
    not very helpful when you don't know actionscript well. does
    anybody have any tips or ideas?

    Hi there,
    What I did, I took a variable 'counter123' and assign '0' value to this variable.
    I then added a button with Advanced action, I am sharing the Screenshot of the advanced action panel.
    Screen shot 1 :
    Incrementing the Value on click :
    The value of the variable should increase on every click, so lets add a true statement as a condition.
    Screenshot no 2 :
    As normally on buttons/click boxes, the project will continue as soon we click them.
    lets compare the value of our variable and then pause the project.
    Screen shot 3 :
    last if our purpose is solved, here we have clicked the button 4 times, so that has updated the value of our counter to 4, so as soon as the counter exceeds the value, we want the project to continue.
    please let me know if this helps you.
    This will help you in pressing a button 4 times, and i think you can also add actions to show and hide 'zeros' in your project.
    I find such scenarios very interesting and I always find help on Lilybiri's Blog : http://lilybiri.posterous.com/
    Thanks

  • Need help with buttons

    stupid question maybe but i'm a beginner, and hey..there are no stupid questions, right? well, i may prove that wrong...anyway...
    I can't relocate a button, or any other component for that matter. When I try to make a simple applet with just one button showing, then it works perfect...but when I make the applet a little bigger with some graphcis and text, the setLocation() and setSize() methods don't work. the wierd part is that I don't get an error message, the compiler just ignores those lines...so it seems anyway.
    If anyone can help me I'd be very greatful
    thanx a lot

    Boss,
    there is something called Layout Management in Java,
    see types of layouts in the Java API.
    Applet default is FlowLayout,
    so modify your layouts and try,
    u need a basic understanding and reading of Layouts
    in Java..take a tutorial...
    gud luck!

  • Need HELP with BUTTONS (help! help!)

    I am trying to create a "return to previous page" button, one that acts like the "Back" arrow on your web browser.
    I want to add this on my Master page, so that every chapter will have the same button in the same place with the same result.
    My manual says that "Return to Previous View" is a button option. But I can't get it to work.
    Please help, I need to finish this thing TODAY (July 16)

    Hate to be the bearer of bad news, but I don't think what you want is going to be so easy. It isn't something you can set up in a snap. And buttons may not be what you want at all. Buttons serve rather simple functions. I think you are looking at Indexing, and some fairly complex indexing at that.
    Now having said that, Return to Previous View does work (You do realize that these buttons only work in a PDF exported with Include Interactive Elements checked, right?), but you need something to get you to that next view in the first place. And I'm not sure how you can define that without indexing. Perhaps you could use anchored objects and Go to Anchor button, but I think the anchor would have to have something placed in it because it's found via the link in the object. Then a button in the appendix could be defined as Return to Previous View to get you back to the page you came from.
    As you can see, this could get pretty messy. Indexing tends to move you around the book much more seamlessly. But it is also something that has to be meticulously set up after the book is completely laid out.
    The InDesigner Podcast has a lesson on indexing as a request from one of his viewers. But in order to explain it he started with a lesson on Book Basics, then one on Table of Contents, Advanced TOC, Indexing, and finally Generating an Index. You can download the five podcasts from the InDesigner.com and watch them to get an idea of what's involved and how it may help in your situation.
    Sorry, but even if someone here with more expertise than I in this matter comes to your aid, you still have quite a bit of learning ahead of you to pull this off.

  • I need help with buttons

    I am creating a GUI program, and I would like to know how to recognize a "mouseover" event on a button. Right now I am using "private JButton Button;" -- is it possible to have a mouseover for that?
    If not, please tell me the steps I need to take in order to be able to have a mouseover event on a button. It is relatively important to the program =P
    Thanks.
    Edit -- I am going to be AFK for a while, please respond with as much info as possible. Thanks again ;-)

    I went to the help section on setRolloverIcon, and I kind of understand it, but what is an "Icon"?
    What I want to happen when I move my mouse over the button is this: TextBox.setText("This button does this: bla bla bla");
    Then I want the text in TextBox to go away when my mouse leaves the button. I know this is possible in some programs, but is it in Java?

  • NEED HELP with an unlocked cingular phone

    I just recently bought an unlocked Cingular palm Treo 750 on ebay. And actually I like the phone but I can not get it to do what I need it to do. I use Suncom as a service provider, who just recently merged with T-mobile. I went to Suncom and they supposedly set everything up so I could get on the interenet. Well....... I can not get any page to come up. It says that the page cannot be displayed and to check the connection. I went to suncom again who told me that unlocked Cingular phones do not work well with suncom and there was nothing they could do. I want to use this phone to help me with my college work and I can not. Does anyone have any type of suggestion for me. I am sooooo frustrated. I have been with suncom for many years but this makes me mad. Can ANYONE HELP ME???
    Post relates to: Treo 750 (Cingular)

    Hello and thank you for using the Palm Help Forums!
    I am very sorry you are having these issues and have a few suggestions that may resolve your issue.
    Make sure the SIM card is inserted correctly before continuing.
    First, you may want to contact T-Mobile to make sure they have the right device provisioned onto their network and that the Treo 680 is supported.
    Second, you could have a bad SIM card. SIM cards are usually free at stores. See if they can swap it out and if that resolves your connection issues.
    Thrid, try a hard reset. A hard reset will erase everything off the device so be sure you backup your data on a computer via hotsync. For further
    instructions on how to do a hard reset, go to kb.palm.com and search for article # 42094 in the solution ID. search field. Before you add any data back onto the device make sure you are able to establish a connection to the T-Mobile network.
    If none if this works, you may have recieved a defective device from ebay. I hope not though.
    Well, I hope one of the suggestions resolve your issue. Let me know if you have any further questions.
    Post relates to: Centro (Sprint)

  • Need help with buttons in applet

    stupid question maybe but i'm a beginner, and hey..there are no stupid questions, right? well, i may prove that wrong...anyway...
    I can't relocate a button, or any other component for that matter. When I try to make a simple applet with just one button showing, then it works perfect...but when I make the applet a little bigger with some graphcis and text, the setLocation() and setSize() methods don't work. the wierd part is that I don't get an error message, the compiler just ignores those lines...so it seems anyway.
    If anyone can help me I'd be very greatful
    thanx a lot

    Do you know there are 5 layout managers in java. It is probably worth looking through each one and the commands they use.
    The layout is determined by two things:
    1.position Components are added
    2.Layout manager used
    Ive never had to use setLocation() and setSize() as the layouts do it for you:
    1.Flowlayout: which is the default pane. e.g.
    setLayout(new Flowlayout()).
    2.GridLayout: postions panels into rows and columns
    b.GridBagLayout
    3.Borderlayout(NORTH,SOUTH,EAST,WEST and CENTER) postions in applet.
    4.CardLayout(a bit like a slideshow)
    5.Insets() which is used to determine top,bottom,left and right.
    Don't bother about 4 or 5 yet. But definitly have a look at the other 3.
    e.g. setLayout(new BorderLayout());
    add("North", new Button("ok"));
    add("CENTER", new Button("Exit");
    etc..

  • NEED HELP WITH BUTTONS IN AS3!!

    Hello, I am stumped with an action scripting problem. I'm
    trying to create a really basic website in flash using buttons to
    jump from scene to scene. Let's say I want to do something as
    simple as make scene 1 jump to scene two right? I'll place in my
    scene 2 button on my first page:
    But instead of the scene changing to the next scene after I
    press the button, these errors come up!!
    1180: Call to a possibly undefined method on.
    1120: Access of undefined property release.
    1120: Access of undefined property _root.
    I've tried asking in so many different forums, I usually do
    pretty good with action scripting for buttons. But this is my first
    time doing it with cs3. I'm utterly confused, someone please help!!
    Thank you.
    The code on this page is the code I was using to try to
    change scenes...Oh! and whenever I try to put a code in the actual
    button, it won't let me. I just get a message that says something
    like "Can't have any actions applied to it".

    foxxpop,
    > But instead of the scene changing to the next scene
    > after I press the button, these errors come up!!
    >
    > 1180: Call to a possibly undefined method on.
    > 1120: Access of undefined property release.
    > 1120: Access of undefined property _root.
    You're using three terms that aren't supported in
    ActionScript 3.0: the
    on() function, the release parameter to that function, and
    _root. In
    ActionScript 3.0, you'll have to give your button an instance
    name and wire
    it up like this:
    http://www.quip.net/blog/2007/flash/making-buttons-work-in-flash-cs3
    In that blog entry, you'll see (with explanation) something
    that looks
    like this:
    myButton.addEventListener(
    MouseEvent.CLICK,
    function(evt:MouseEvent):void {
    trace("I've been clicked!");
    Just bear in mind that you can also make that a named
    function, like
    this:
    myButton.addEventListener(MouseEvent.CLICK, clickHandler);
    function clickHandler(evt:MouseEvent):void {
    trace("I've been clicked!");
    > I've tried asking in so many different forums, I usually
    do
    > pretty good with action scripting for buttons. But this
    is
    > my first time doing it with cs3.
    Your issue isn't Flash CS3, it's that your FLA file is
    configured for
    ActionScript 3.0. If you change that to AS2, you can go right
    on using the
    same approach you used to -- and you'll be able to attach
    code directly to
    objects. ;)
    David Stiller
    Co-author, The ActionScript 3.0 Quick Reference Guide
    http://tinyurl.com/2s28a5
    "Luck is the residue of good design."

  • Need help with Buttons/Events

    HI
    Here is what I am doing. I am creating an "operations"
    calendar for my workplace. So far I have been successful with
    creating the page, inserting links, tags, images etc.....
    But now I want to add an Event button - where once the button
    is clicked - it will launch a script on my UNIX server.
    Cant quite figure this one out
    Any help would be greatly appreciated

    Hey man, I 've done some correction, and it seems work, why don't you try the code to see if it is what you want.
    import java.awt.*;
    import java.applet.*;
    import java.awt.event.*;
    public class ComplexMenu11 extends Applet implements ActionListener {
    Button open, close;
    MenuFrame f;
    public void init() {
    open = new Button("Open");
    add(open);
    open.addActionListener(this);
    close = new Button("Close");
    add(close);
    close.addActionListener(this);
    f = new MenuFrame("A Complex menu");
    f.setSize(200, 200);
    f.show();
    public void actionPerformed(ActionEvent evt) {
    if(evt.getSource() == open) {
    if(f.isShowing())
    f.show();
    }else{
    if(!f.isShowing())
    f.hide();
    class MenuFrame extends Frame implements ActionListener{  //and implements here too
    Font font;
    Label l;
    int fontsize;
    //MessageDialog md;
    MenuBar mb = new MenuBar();
    Menu m1 = new Menu("Colours");
    MenuFrame(String name) {
    super(name);
    m1.add(new MenuItem("White"));
    m1.add(new MenuItem("Light grey"));
    m1.add(new MenuItem("Yellow"));
    Menu m2 = new Menu("Font");
    m2.add(new MenuItem("10"));
    m2.add(new MenuItem("12"));
    m2.add(new MenuItem("14"));
    m2.add(new MenuItem("16"));
    m2.add(new MenuItem("18"));
    m2.add(new MenuItem("Message"));
    mb.add(m1);
    mb.add(m2);
    setMenuBar(mb);
    m1.addActionListener(this); //Add listener here
    l = new Label("A frame demonstration", Label.CENTER);
    add("South", l);
    //md = new MessageDialog(this,"Name",true);
    public void actionPerformed(ActionEvent evt) {
    if(evt.getSource() instanceof MenuItem) {
    //fontsize = 18;
    String label = evt.getActionCommand();
    if(label.equals("White")) {
    //setBackground(Color.white);
    System.out.println("This is the white point");
    }

  • Need help with buttons and fading clips

    howdy,
    I have 3 buttons on a stage that play 3 different movies.
    While no button is pressed, there is a looping video on the stage
    playing. When a button is pressed, that looping movie needs to fade
    out and fade in the movie that button calls for. I have attached
    script but it isn't working at all. Not sure where to go from here.
    thanks for your help.

    Hello again,
    Now I'm completely lost. Where should I add that code in your
    last post?
    thanks.

  • Please Help - Need Help with Buttons for GUI for assignment. URGENT!!

    Can someone please help me with the buttons on this program? I cannot figure out how to get them to work.
    Thanks!!!
    import java.awt.*;
    import java.awt.event.*;
    import java.text.NumberFormat;
    import javax.swing.*;
    import javax.swing.JButton;
    public class InventoryTAH implements ActionListener
        Maker[] proMaker;
        JTextField[] fields;
        NumberFormat nf;
        public void actionPerformed(ActionEvent e)
            int index = ((JComboBox)e.getSource()).getSelectedIndex();
            populateFields(index);
        public static void main(String[] args)
            try
                UIManager.setLookAndFeel(
                        "com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
            catch (Exception e)
                System.err.println(e.getClass().getName() + ": " + e.getMessage());
            InventoryTAH test = new InventoryTAH();
            test.initMakers();
            test.showGUI();
            test.populateFields(0);
        private void initMakers() {
            proMaker = new Maker[10];
            proMaker[0] = new Maker( 1, "Pens",1.59,100,"Bic");
            proMaker[1] = new Maker( 2, "Pencils", .65, 100,"Mead");
            proMaker[2] = new Maker( 3, "Markers", 1.29, 100,"Sharpie");
            proMaker[3] = new Maker( 4, "Paperclips", 1.19, 100,"Staples");
            proMaker[4] = new Maker( 5, "Glue", .85, 100,"Elmer's");
            proMaker[5] = new Maker( 6, "Tape", .50, 100,"3m");
            proMaker[6] = new Maker( 7, "Paper", 1.85, 100,"Mead");
            proMaker[7] = new Maker( 8, "Stapler", 2.21, 100,"Swingline");
            proMaker[8] = new Maker( 9, "Folders", .50, 100,"Mead");
            proMaker[9] = new Maker( 10, "Rulers", .27, 100,"Stanley");      
          int maxNum = 10;
          int currentNum = 0;
          int currentInv = 0;
             Action firstAction = new AbstractAction("First")
              public void actionPerformed(ActionEvent evt)
                   currentInv = 0;
                   int populateFields;
          JButton firstButton = new JButton(firstAction);
          Action previousAction = new AbstractAction("Previous")
              public void actionPerformed(ActionEvent evt)
                   currentInv--;
                   if (currentInv < 0)
                        currentInv = maxNum - 1;
                   int populateFields;
          JButton previousButton = new JButton(previousAction);
          Action nextAction  = new AbstractAction("Next")
              public void actionPerformed(ActionEvent evt)
                   currentInv++;
                   if (currentInv >= currentNum)
                        currentInv = 0;
                  int populateFields;
          JButton nextButton = new JButton(nextAction);
          Action lastAction = new AbstractAction("Last")
              public void actionPerformed(ActionEvent evt)
                   currentInv = currentNum - 1;
                   int populateFields;
          JButton lastButton = new JButton(lastAction);
              JPanel buttonPanel = new JPanel( );
        private void showGUI() {
            JLabel l;
            JButton button1;
                JButton button2;
            fields = new JTextField[8];
            JFrame f = new JFrame("Inventory");
            Container cp = f.getContentPane();
            cp.setLayout(new GridBagLayout());
            cp.setBackground(UIManager.getColor(Color.BLACK));
            GridBagConstraints c = new GridBagConstraints();
            c.gridx = 0;
            c.gridy = GridBagConstraints.RELATIVE;
            c.gridwidth = 1;
            c.gridheight = 1;
            c.insets = new Insets(2, 2, 2, 2);
            c.anchor = GridBagConstraints.EAST;
            cp.add(l = new JLabel("Item Number:", SwingConstants.CENTER), c);
            l.setDisplayedMnemonic('a');
            cp.add(l = new JLabel("Item Name:", SwingConstants.CENTER), c);
            l.setDisplayedMnemonic('b');
            cp.add(l = new JLabel("Number of Units in Stock:", SwingConstants.CENTER), c);
            l.setDisplayedMnemonic('c');
            cp.add(l = new JLabel("Price per Unit: $", SwingConstants.CENTER), c);
            l.setDisplayedMnemonic('d');
            cp.add(l = new JLabel("Total cost of Item: $", SwingConstants.CENTER), c);
            l.setDisplayedMnemonic('e');
            cp.add(l = new JLabel("Total Value of Merchandise in Inventory: $", SwingConstants.CENTER), c);
            l.setDisplayedMnemonic('f');
            cp.add(l = new JLabel("Manufacturer:", SwingConstants.CENTER), c);
            l.setDisplayedMnemonic('g');
            cp.add(l = new JLabel("Restocking Fee: $", SwingConstants.CENTER), c);
            l.setDisplayedMnemonic('h');
                c.gridx = 1;
            c.gridy = 0;
            c.weightx = 1.0;
            c.fill = GridBagConstraints.HORIZONTAL;
            c.anchor = GridBagConstraints.CENTER;
            cp.add(fields[0] = new JTextField(), c);
            fields[0].setFocusAccelerator('a');
            c.gridx = 1;
            c.gridy = GridBagConstraints.RELATIVE;
            cp.add(fields[1] = new JTextField(), c);
            fields[1].setFocusAccelerator('b');
            cp.add(fields[2] = new JTextField(), c);
            fields[2].setFocusAccelerator('c');
            cp.add(fields[3] = new JTextField(), c);
            fields[3].setFocusAccelerator('d');
            cp.add(fields[4] = new JTextField(), c);
            fields[4].setFocusAccelerator('e');
            cp.add(fields[5] = new JTextField(), c);
            fields[5].setFocusAccelerator('f');
            cp.add(fields[6] = new JTextField(), c);
            fields[6].setFocusAccelerator('g');
            cp.add(fields[7] = new JTextField(), c);
            fields[7].setFocusAccelerator('h');
            c.weightx = 0.0;
            c.fill = GridBagConstraints.NONE;
              cp.add(firstButton);
              cp.add(previousButton);
              cp.add(nextButton);
              cp.add(lastButton);
                          JComboBox combo = new JComboBox();
            for(int j = 0; j < proMaker.length; j++)
                combo.addItem(proMaker[j].getName());
            combo.addActionListener(this);
                cp.add(combo);
                cp.add(button1 = new JButton("   "), c);
            f.pack();
            f.addWindowListener(new WindowAdapter()
                public void windowClosing(WindowEvent evt)
                    System.exit(0);
            f.setVisible(true);
      private void populateFields(int index) {
            Maker maker = proMaker[index];
            fields[0].setText(Long.toString(maker.getNumberCode()));
            fields[1].setText(maker.getName());
            fields[2].setText(Long.toString(maker.getUnits()));
            fields[3].setText(Double.toString(maker.getPrice()));
            fields[4].setText(Double.toString(maker.getSum()));
            fields[5].setText(Double.toString(maker.totalAllInventory(proMaker)));
            fields[6].setText(maker.getManufact());
            fields[7].setText(Double.toString(maker.getSum()*.05));       
    class Maker {
        int itemNumber;
        String name;
        int units;
        double price;
        String manufacturer;
        public Maker(int n, String name, double price, int units, String manufac) {
            itemNumber = n;
            this.name = name;
            this.price = price;
            this.units = units;
            manufacturer = manufac;
        public int getNumberCode() { return itemNumber; }
        public String getName() { return name; }
        public int getUnits() { return units; }
        public double getPrice() { return price; }
        public double getSum() { return units*price; }
        public String getManufact() { return manufacturer; }
        public double totalAllInventory(Maker[] makers) {
            double total = 0;
            for(int j = 0; j < makers.length; j++)
                total += makers[j].getSum();
            return total;
    }}

    // I have made some modifications. Please try this.
    import java.awt.*;
    import java.awt.event.*;
    import java.text.NumberFormat;
    import javax.swing.*;
    import javax.swing.JButton;
    public class InventoryTAH implements ActionListener
    Maker[] proMaker;
    JTextField[] fields;
    NumberFormat nf;
    int currentInv = 0;
    public void actionPerformed(ActionEvent e)
    currentInv= ((JComboBox)e.getSource()).getSelectedIndex();
    populateFields(currentInv);
    public static void main(String[] args)
    try
    UIManager.setLookAndFeel(
    "com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    catch (Exception e)
    System.err.println(e.getClass().getName() + ": " + e.getMessage());
    InventoryTAH test = new InventoryTAH();
    test.initMakers();
    test.showGUI();
    test.populateFields(0);
    private void initMakers() {
    proMaker = new Maker[10];
    proMaker[0] = new Maker( 1, "Pens",1.59,100,"Bic");
    proMaker[1] = new Maker( 2, "Pencils", .65, 100,"Mead");
    proMaker[2] = new Maker( 3, "Markers", 1.29, 100,"Sharpie");
    proMaker[3] = new Maker( 4, "Paperclips", 1.19, 100,"Staples");
    proMaker[4] = new Maker( 5, "Glue", .85, 100,"Elmer's");
    proMaker[5] = new Maker( 6, "Tape", .50, 100,"3m");
    proMaker[6] = new Maker( 7, "Paper", 1.85, 100,"Mead");
    proMaker[7] = new Maker( 8, "Stapler", 2.21, 100,"Swingline");
    proMaker[8] = new Maker( 9, "Folders", .50, 100,"Mead");
    proMaker[9] = new Maker( 10, "Rulers", .27, 100,"Stanley");
         int maxNum = 10;
         int currentNum = 0;
    Action firstAction = new AbstractAction("First")
              public void actionPerformed(ActionEvent evt)
                   currentInv = 0;
                   populateFields(currentInv);
         JButton firstButton = new JButton(firstAction);
         Action previousAction = new AbstractAction("Previous")
              public void actionPerformed(ActionEvent evt)
                   currentInv--;
                   if (currentInv < 0)
                        currentInv = maxNum - 1;
                   populateFields(currentInv);
         JButton previousButton = new JButton(previousAction);
         Action nextAction = new AbstractAction("Next")
              public void actionPerformed(ActionEvent evt)
                   currentInv++;
                   if (currentInv >= maxNum)
                        currentInv = 0;
              populateFields(currentInv);
         JButton nextButton = new JButton(nextAction);
         Action lastAction = new AbstractAction("Last")
              public void actionPerformed(ActionEvent evt)
                   currentInv = maxNum-1;
                   populateFields(currentInv);
         JButton lastButton = new JButton(lastAction);
              JPanel buttonPanel = new JPanel( );
    private void showGUI() {
    JLabel l;
    JButton button1;
              JButton button2;
    fields = new JTextField[8];
    JFrame f = new JFrame("Inventory");
    Container cp = f.getContentPane();
    cp.setLayout(new GridBagLayout());
    cp.setBackground(UIManager.getColor(Color.BLACK));
    GridBagConstraints c = new GridBagConstraints();
    c.gridx = 0;
    c.gridy = GridBagConstraints.RELATIVE;
    c.gridwidth = 1;
    c.gridheight = 1;
    c.insets = new Insets(2, 2, 2, 2);
    c.anchor = GridBagConstraints.EAST;
    cp.add(l = new JLabel("Item Number:", SwingConstants.CENTER), c);
    l.setDisplayedMnemonic('a');
    cp.add(l = new JLabel("Item Name:", SwingConstants.CENTER), c);
    l.setDisplayedMnemonic('b');
    cp.add(l = new JLabel("Number of Units in Stock:", SwingConstants.CENTER), c);
    l.setDisplayedMnemonic('c');
    cp.add(l = new JLabel("Price per Unit: $", SwingConstants.CENTER), c);
    l.setDisplayedMnemonic('d');
    cp.add(l = new JLabel("Total cost of Item: $", SwingConstants.CENTER), c);
    l.setDisplayedMnemonic('e');
    cp.add(l = new JLabel("Total Value of Merchandise in Inventory: $", SwingConstants.CENTER), c);
    l.setDisplayedMnemonic('f');
    cp.add(l = new JLabel("Manufacturer:", SwingConstants.CENTER), c);
    l.setDisplayedMnemonic('g');
    cp.add(l = new JLabel("Restocking Fee: $", SwingConstants.CENTER), c);
    l.setDisplayedMnemonic('h');
              c.gridx = 1;
    c.gridy = 0;
    c.weightx = 1.0;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.anchor = GridBagConstraints.CENTER;
    cp.add(fields[0] = new JTextField(), c);
    fields[0].setFocusAccelerator('a');
    c.gridx = 1;
    c.gridy = GridBagConstraints.RELATIVE;
    cp.add(fields[1] = new JTextField(), c);
    fields[1].setFocusAccelerator('b');
    cp.add(fields[2] = new JTextField(), c);
    fields[2].setFocusAccelerator('c');
    cp.add(fields[3] = new JTextField(), c);
    fields[3].setFocusAccelerator('d');
    cp.add(fields[4] = new JTextField(), c);
    fields[4].setFocusAccelerator('e');
    cp.add(fields[5] = new JTextField(), c);
    fields[5].setFocusAccelerator('f');
    cp.add(fields[6] = new JTextField(), c);
    fields[6].setFocusAccelerator('g');
    cp.add(fields[7] = new JTextField(), c);
    fields[7].setFocusAccelerator('h');
    c.weightx = 0.0;
    c.fill = GridBagConstraints.NONE;
              cp.add(firstButton);
              cp.add(previousButton);
              cp.add(nextButton);
              cp.add(lastButton);
                        JComboBox combo = new JComboBox();
    for(int j = 0; j < proMaker.length; j++)
    combo.addItem(proMaker[j].getName());
    combo.addActionListener(this);
              cp.add(combo);
              cp.add(button1 = new JButton(" "), c);
    f.pack();
    f.addWindowListener(new WindowAdapter()
    public void windowClosing(WindowEvent evt)
    System.exit(0);
    f.setVisible(true);
    private void populateFields(int index) {
    Maker maker = proMaker[index];
    fields[0].setText(Long.toString(maker.getNumberCode()));
    fields[1].setText(maker.getName());
    fields[2].setText(Long.toString(maker.getUnits()));
    fields[3].setText(Double.toString(maker.getPrice()));
    fields[4].setText(Double.toString(maker.getSum()));
    fields[5].setText(Double.toString(maker.totalAllInventory(proMaker)));
    fields[6].setText(maker.getManufact());
    fields[7].setText(Double.toString(maker.getSum()*.05));
    class Maker {
    int itemNumber;
    String name;
    int units;
    double price;
    String manufacturer;
    public Maker(int n, String name, double price, int units, String manufac) {
    itemNumber = n;
    this.name = name;
    this.price = price;
    this.units = units;
    manufacturer = manufac;
    public int getNumberCode() { return itemNumber; }
    public String getName() { return name; }
    public int getUnits() { return units; }
    public double getPrice() { return price; }
    public double getSum() { return units*price; }
    public String getManufact() { return manufacturer; }
    public double totalAllInventory(Maker[] makers) {
    double total = 0;
    for(int j = 0; j < makers.length; j++)
    total += makers[j].getSum();
    return total;
    }}

  • 10.9.5 update issues -- need help with sync to LG phone

    1. Can't sync contacts from imac to Gmail. End goal is to sync contacts to LG phone
    2. Notes missing after update
    3. Not all calendar entries show up on LG phone

    While 2 GB is the absolute minimum to install Mavericks, if you want to do anything with the Mac you need more then that. Upgrade your RAM.
    Until you upgrade the RAM seriously consider shutting down the Mac nightly. You should also seriously review the items in the User Login Items to see if there are any there that you really don't need to have startup with your login to reduce the amount of RAM you are using.

  • I need help with button coding to go to the next scene

    Hi! I have been using flash cs5 for a few years now and I've never been great with coding since i usually just do swf animations. However I am in the process of writing a story/book and I wanted to make a little guide for all of the dragons species in the story.
    Example: I had it so there is a title screen and a start button, you click the start button and you are taken to the next scene; which is a picture of a mist dragon I drew and then audio plays; describing mist dragons. in the corner there is a "next" button and when you click it, it takes you to the next species and the audio plays just like with the mist dragon.
    my major problem is my code is muffed up( I know it is totally incomplete, but this code is what I am comfortable working with, anybody know whaat the full code is?). I typed in what I could remember from class... could anybody help me?
    here is the code i remembered:
    Stop();
    btn1.addEventListener(MouseEvent.CLICK…
    function btn1Listener(e:MouseEvent):void {
    gotoAndStop(1, "mist dragon");

    use:
    Stop();
    btn1.addEventListener(MouseEvent.CLICK,btn1Listener);
    function btn1Listener(e:MouseEvent):void {
    gotoAndStop(1, "mist dragon"); //<- you may want gotoAndPlay(1,"mist dragon")

Maybe you are looking for