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;
}}

Similar Messages

  • PLEASE HELP with Audio for YouTube!

    Hi,
    I KNOW YouTube is not the best for quality, but I absolutely HAVE TO post a couple of videos there!
    So.... having used Standard footage & the regular preset for DV-shot footage, does anyone KNOW which Encoding conversion to use (and I assume bitrate selection as well) that will allow me to post them on YouTube and actually hear something which even resembles the professionally Mastered recordings I am using.  So far I have tried WMV, h264 & a few others with various bitrates and most all of them sound horrible once YT converts them.  I was fine with the WMV video but the audio is way to disgusting to even listen to (especially compared to what the audio actually really is).  I have read some posts here suggesting FLV, WMV, etc, & I am truly at a loss and in major need of help here.  I have read Eddie's article link, & still the audio once YT does "it's thing" is ridiculous!
    The audio sounds great (good enough) on my computer after Encoder does its thing, but if anyone has encountered this and has the answer....PLEASE - what conversion & WHAT BITRATE should I use to make YT NOT ruin my recordings (and sound good on there)?!?!
    I even considered importing an already converted AAC or mp3 audio file into Pro, & then exporting it via Media Encoder but don't even think that's possible (or necessary).
    Please help as I HAVE to post it on YT yesterday already!
    As always, thank you for you help!!

    I never really had problems with sound quality on youtube...but I just use stereo pcm/wav mostly in editor. I think you should post what your using in your project and what you are exporting it as...cause its too vague to really give much specific advice re: helping you. also, say whether you have any sound codec packs or anything loaded...anything other than the original program codecs...and say what version of the product you are using...premiere pro what ??

  • Please help with update for ios 8.1.3

    Some one PLEASE HELP ME!!!  I just updated my I phone 4s to ios 8.1.3 it was taking a long time then they finally updated and had the Hello screen after that I saw my photos then they would just delete it right in front of me I also lost some of my contacts but my notes still here can someone please help me find my photos are very important to me they have pictures of my relatives who passed away please help!!!

    After 4+ months of dealing with this data usage and battery drain problem that included 3 data captures of my wife's iMac, the trigger for us regarding the problems syncing with iCloud, and 5 hours of logs off my iPhone 6 to be analyzed by Apple engineers that included times my wife's computer was both on and off to demonstrate the difference in data usage and battery drain under those conditions, I can say with very reasonable certainty that the iOS 8.3 and corresponding Mac OS 10.10.3 update has solved the problem. 
    We have now been running for about 2 weeks and data usage with the iCloud Servers attempting to sync has dropped from a rate of 31 GBs to under 15 MBs per month.  Yes, you read it right.  We were burning 2000 times as much data doing absolutely nothing important on both of our phones, a 5s and a 6.  Just imagine what that does to battery life!  The 5s would last about 5 hours and the 6 was dead in less than 14.
    The distasteful aspect of this process was how the engineers were quietly fixing the problem at the same time sending messages to my contact person within Apple that were dismissive in nature in the face of indisputable unreasonable results. I must say, this experience with the multiple times the engineers' responses were inappropriate put a little tarnish on the old Apple shine of the ‘It just works’ mantra. This was my first experience in 34 years that caused me to stop recommending Apple products without reservations and with a disclaimer.
    Since the update solved the problem, then I can only conclude that there was a logic bug regarding the reaction within the process to the incoming data that was corrected.  There was noting short of logging out of iCloud that circumvented the problem for us, Gator5000e and probably many others noted on other threads.  I am not trying to imply that this is the cause of everyones battery use problem, but it is reasonable that it was a cause for many.

  • Help with buttons in gui

    I need to create first, last, next, and previous buttons in my gui. I have them in there (in the code), but only one button shows up (instead of four), and it has "first" overlapped with the "previous" button. The "next" and "last" don't even show up at all.
    Can some one guide me please? Can someone tell me what I am doing wrong?? Thank you in advance
    Here is my maker.java which houses the navigation panel
    package inventorymain;
    import javax.swing.JFrame;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.io.*;
    import java.text.NumberFormat;
    import javax.swing.border.*;
    import java.net.*;
    import java.util.StringTokenizer;
    class Maker extends Inventory implements ActionListener
    {//begins Class Maker
        static String manufact[] = new String[10];
        static double restockingFee[] = new double[10];
        static int i;
        static double TotalVal;
        static int navItem;
        private Container cp = getContentPane();
        GridBagConstraints c;
        GridBagConstraints cconstraint;
        Border titledborder;
        JPanel pan;
        String labels[] = {"Product Name:", "Manufacturer:", "Product ID Number:", "Units in Stock:", 
                           "Price Per Unit: $", "Restocking Fee: $", "Value of Product in Stock Plus Restocking Fee: $",
                           "Value of All Merchandise Plus Restocking Fees: $"};
        int len1 = labels.length;
        JLabel lbl[] = new JLabel[len1];
        JTextField txtfield1[] = new JTextField[len1];
        String blabels[] = {"First", "Previous", "Next", "Last"};
        int blen = blabels.length;
        JButton navigate[] = new JButton[blen];
        JLabel lblImg;
        File file;
        public String FileName;
        public Maker(int Item_Number, String Item_Name, double Item_Price, int Items_in_Stock, String manufact, double restockingFee)// Constructor for varibles
            super(Item_Number, Item_Name, Item_Price, Items_in_Stock);
            this.manufact[i] = manufact;
            this.restockingFee[i] = restockingFee;
            i = i + 1;
        public static void setManufact(int k, String value)
            manufact[k] = value;
        public static double getRestockFee(int val)
            return restockingFee[val];
        public void ShowInventory()
            setLayout(new FlowLayout());
            GridBagLayout contlayout = new GridBagLayout();//layout for container
            GridBagConstraints cconstraint = new GridBagConstraints();//constraint for container
            GridBagLayout gblayout = new GridBagLayout();//layout for panel
            GridBagConstraints gbconstraint = new GridBagConstraints();
            try
                //first panel
                pan = new JPanel();
                gblayout = new GridBagLayout();
                gbconstraint = new GridBagConstraints();
                pan.setLayout(gblayout);
                for (int i = 0; i < 2; i++)
                    for (int j = 0; j < len1; j++)
                        int x = i;
                        int y = j;
                        if (x == 0)
                            lbl[j] = new JLabel(labels[j]);
                            lbl[j].setHorizontalAlignment(JLabel.LEFT);
                            lbl[j].setPreferredSize(new Dimension(250, 15));
                            gbconstraint.insets = new Insets(10, 0, 0, 0);
                            gbconstraint.gridx = x;
                            gbconstraint.gridy = y;
                            pan.add(lbl[j], gbconstraint);
                        }//end if
                        else
                            txtfield1[j] = new JTextField(15);
                            txtfield1[j].setPreferredSize(new Dimension(300, 15));
                            txtfield1[j].setHorizontalAlignment(JLabel.LEFT);
                            txtfield1[j].setEnabled(false);
                            lbl[j].setLabelFor(txtfield1[j]);
                            gbconstraint.gridx = x;
                            gbconstraint.gridy = y;
                            pan.add(txtfield1[j], gbconstraint);                       
                        }//end else
                    }//end for
                }//end for
                Border titledborder = BorderFactory.createTitledBorder("Current Inventory Data");
                pan.setBorder(titledborder);
                //adds panel to container
                cconstraint.gridwidth = 1;
                cconstraint.gridheight = 1;
                cconstraint.gridx = 0;
                cconstraint.gridy = 0;
                cp.add(pan, cconstraint);
                //add icon to display
                pan = new JPanel();
                gblayout = new GridBagLayout();
                gbconstraint = new GridBagConstraints();
                pan.setLayout(gblayout);
                gbconstraint.gridwidth = 1;
                gbconstraint.gridheight = 1;
                gbconstraint.gridy = 0;
                lblImg = new JLabel((new ImageIcon(getClass().getResource("logo111.jpg"))));
                lblImg.setPreferredSize(new Dimension(120, 60));
                pan.add(lblImg);
                cconstraint.gridwidth = 1;
                cconstraint.gridheight = 1;
                cconstraint.gridx = 0;
                cconstraint.gridy = 1;
                cp.add(pan, cconstraint);
                //navigation panel
                pan = new JPanel();
                gblayout = new GridBagLayout();
                gbconstraint = new GridBagConstraints();
                pan.setLayout(gblayout);
                gbconstraint.gridwidth = 1;
                gbconstraint.gridheight = 1;
                gbconstraint.gridx = 0;
                gbconstraint.gridy = 1;
                for (int i = 0; i < blen; i++)
                    navigate[i] = new JButton(blabels);
    gbconstraint.gridx = 1;
    pan.add(navigate[i], gbconstraint);
    navigate[i].addActionListener(this);
    }//end for
    titledborder = BorderFactory.createTitledBorder("Navigation");
    pan.setBorder(titledborder);
    //add panel to container
    cconstraint.gridwidth = 4;
    cconstraint.gridheight = 1;
    cconstraint.gridx = 1;
    cconstraint.gridy = 1;
    cp.add(pan, cconstraint);
    ShowInventory(0);
    }//end try
    catch (Exception e)
    e.printStackTrace();
    }//end catch
    }//end showInventory
    public void ShowInventory(int ItemNo)
    txtfield1[0].setText(Integer.toString(ItemNo));
    txtfield1[0].setText(Inventory.getItemName(ItemNo));
    txtfield1[1].setText(manufact[ItemNo]);
    txtfield1[2].setText(Integer.toString(Inventory.getItemNum(ItemNo)));
    txtfield1[3].setText(Integer.toString(Inventory.getItemUnits(ItemNo)));
    txtfield1[4].setText(Double.toString(Inventory.getItemPrice(ItemNo)));
    txtfield1[5].setText(String.format("%3.2f",
    Products.totalOfRestockFee(Inventory.getItemPrice(ItemNo),
    getRestockFee(ItemNo))));
    txtfield1[6].setText(String.format("%3.2f",
    Products.totalOfInventory(Inventory.getItemPrice(ItemNo),
    Inventory.getItemUnits(ItemNo), getRestockFee(ItemNo))));
    txtfield1[7].setText(String.format("%3.2f",
    GetTotalInvVal()));
    }//end ShowInventory(int ItemNo)
    public void EnableFields(boolean bflag)
    txtfield1[1].setEnabled(bflag);
    txtfield1[2].setEnabled(bflag);
    txtfield1[3].setEnabled(bflag);
    txtfield1[4].setEnabled(bflag);
    txtfield1[5].setEnabled(bflag);
    }//end EnableFields
    public double GetTotalInvVal()
    TotalVal = 0;
    for(int j = 0; j < Inventory.getCount(); j++)
    TotalVal += Products.totalOfInventory(Inventory.getItemPrice(j),
    Inventory.getItemUnits(j), getRestockFee(j));
    return TotalVal;
    }//end GetTotalInvVal
    public void actionPerformed(ActionEvent e)//button actions
    String btnClicked = ((JButton)e.getSource()).getText();
    if (btnClicked.equals("First"))
    EnableFields(false);
    navItem = 0;
    ShowInventory(navItem);
    }//end if
    if (btnClicked.equals("Next"))
    EnableFields(false);
    if (navItem == getCount() - 1)
    navItem = 0;
    }//end if
    else
    navItem += 1;
    }//end else
    ShowInventory(navItem);
    }//end if
    if (btnClicked.equals("Previous"))
    EnableFields(false);
    if (navItem == 0)
    navItem = getCount() - 1;
    }//end if
    else
    navItem = navItem - 1;
    }//end else
    ShowInventory(navItem);
    }//end if
    if (btnClicked.equals("Last"))
    EnableFields(false);
    navItem = getCount() - 1;
    ShowInventory(navItem);
    }//end if
    }//end ActionPerformed
    }// end of class Maker

    for (int i = 0; i < blen; i++)
             navigate[i] = new JButton(blabels);
    gbconstraint.gridx = 1; // ---- > You mean for this be = i, No?
         // Somehow you need to be resetting the grid x for each button added     
    pan.add(navigate[i], gbconstraint);
    navigate[i].addActionListener(this);
    }//end for
    Or check out gridx = GridBagConstraints.RELATIVE
    Message was edited by:
    nantucket

  • Please help with sizing for a canvas wrap

    I have looked at every video possible on this. I don't know what I am doing wrong?
    RIght now my image size in cs3 is
    60.2m
    5616x3744 in pixels
    18.72x12.48 in inches at 300 dpi
    I want to make my image capable of being a 36x24 inch gallery wrap. I realize I have to go into image size but when I raise it to a 36x24 my calculations go out the roof! Is that okay?
    222.5M
    10800x7200 pixels
    36x24 in inches at 300 dpi
    Can I send something that large to a printing lab?
    Sorry this is only my second time to do a gallery wrap and I am clueless about image size as far as measurements go!
    I do have a 5d mark2 shooting RAW always that should allow me to have an image size of this quality easily right?

    Grant
    That is exactly why I am posting this... I HAVE NO FREAKING CLUE that I can reduce the dpi and if so how low can I go with my image needing to be sized at 36x24? Sorry, I am really just kidding around! I am no computer whiz with digital stuff, my love is strictly photography. I am so scared I will loose the quality I don't want to make a wrong move. I don't even know if I am suppose to up my size that much. I know my camera is good, but when it spits out a size like 18x12 in cs3 how high can I size it up and drop the dpi before I loose quality? Is there some kind of chart for this?
    Thanks for your help!

  • Please help with snippet for form.

    I'm building my wedding photography site with iWeb and I want to place a form on there where customers can, via a series of pull down menus, choose various addons to their wedding package which I want to show a running total at the bottom for an instant quote. I would then need to get a copy of this data sent to me.
    What kind of HTML snippet would I need and where could I find one?
    Thanks in advance.

    Thanks Scott, that jot form looks great for a contact form etc. Due to being add free. But it doesn't look like it allows me to add a value to a selection on a drop down menu and a way of adding it up/displaying the total on my site.
    Example id need fields like this;
    "album required"
    The available selections could be:
    "12 x 8" value added to viable running total would be £100
    "14 x 10" value added to viable running total would be £150
    "16 x 12" value added to viable running total would be £200
    Then another field may be:
    "Hi Res CD required?"
    the available selections could be:
    "no thanks!" having a value of £0
    "50 images" having a value of £100
    "all images" having a value of £250
    So if the user chooses "16 x 12" and "all images" the running total on the page would show the user "£450"
    Any help would be greatly appreciated.
    Thanks!

  • Please help with script for right-mouse click on 3D objects

    Hi!
    I have PDF file with two simple 3d objects (for example with two cube).
    I need to make script that when user right-click to first cube, a PDF file (c:\a.pdf) opening (or c:\b.pdf for second one) in new windows. How to make it? Thank you so much!

    Hi,
    please check SDK sample 22 Right-Click, there is everything you need.
    First catch RightClickEvent, then create the menu entry when beforeAction = true, and when beforeAction = false you have to remove it again (otherwise you will receive an error when rightclicking again).
    Regards
    Sebastian

  • Please help with query for 5 lastest opening balance  !!!!!!!!!!!

    Can anyone plese tell me or guide me how to write the query to show the 5 lastest opening balance from the A/R invoice on the specific BP partner?
    Example
    The box to input "BP partner"
    and then show,
    Lastest transaction | Ship date | Invoice number | Balance Amount | Culmulative
    1    
    2
    3
    4
    5
    Your help will be very very appreciated.

    This is very good but I would like to show only the top 5 remaining invoice. I think that I have to combine it with JDT1. I have seen one query that may be able to apply on my case.
    SELECT
    T1.CardCode + '' AS 'BP Code',
    T2.Notes2 AS 'BP Name',
    T0.RefDate,
    CASE
         WHEN T0.TransType = 13 THEN 'IN'
         WHEN T0.TransType = 14 THEN 'CN'
         WHEN T0.TransType = 30 THEN 'JE'
         WHEN T0.TransType = 24 THEN 'RC'
         WHEN T0.TransType = 46 THEN 'PS'
         ELSE 'Error ! ! !'
    END AS 'Doc Type',
    T0.Ref1 'Doc. Number',
    ISNULL(T0.FCCurrency, ' - ') AS 'Ccy',
    (T0.BalFcDeb - T0.BalFcCred) AS 'Bal. F. Ccy',
    (T0.BalDueDeb - T0.BalDueCred) AS 'Bal. Rs',
    ISNULL((SELECT T0.BalDueDeb -T0.BalDueCred WHERE DateDiff(mm, T0.RefDate, '[%1]') <= -1)                     ,0) AS 'Future',
    ISNULL((SELECT T0.BalDueDeb -T0.BalDueCred WHERE DateDiff(mm, T0.RefDate, '[%1]') = 0)                         ,0) AS 'Current Mth',
    ISNULL((SELECT T0.BalDueDeb -T0.BalDueCred WHERE DateDiff(mm, T0.RefDate, '[%1]') = 1)                         ,0) AS '1 Mth Ago',
    ISNULL((SELECT T0.BalDueDeb -T0.BalDueCred WHERE DateDiff(mm, T0.RefDate, '[%1]') = 2)                         ,0) AS '2 Mth Ago',
    ISNULL((SELECT T0.BalDueDeb -T0.BalDueCred WHERE DateDiff(mm, T0.RefDate ,'[%1]') = 3)                         ,0) AS '3 Mth Ago',
    ISNULL((SELECT T0.BalDueDeb -T0.BalDueCred WHERE DateDiff(mm, T0.RefDate, '[%1]') between 4 and 6)    ,0) AS '4 - 6 Mth Ago',
    ISNULL((SELECT T0.BalDueDeb -T0.BalDueCred WHERE DateDiff(mm, T0.RefDate, '[%1]') >= 7)                       ,0) AS '>7 Mth Ago'
    FROM JDT1 T0
    INNER JOIN OCRD T1 ON T0.ShortName = T1.CardCode
    LEFT OUTER JOIN OCPR T2 ON T1.CardCode = T2.Cardcode
    LEFT OUTER JOIN OJDT T3 ON T0.TransID = T3.TransID
    LEFT OUTER JOIN OINV  T4 ON T3.TransID = T4.TransID
    LEFT OUTER JOIN ORIN  T5 ON T3.TransID = T5.TransID
    WHERE
    T1.CardType = 'C' and Balance != 0
    and (T0.BalDueDeb - T0.BalDueCred) != 0
    but still try to figure it out....

  • Please help with the FOR loop and the array..

    I was trying to place some words in the Movie Clip
    "TextPanel" and set a
    random position to each of them.
    But it's not working.
    1) I created a Movie Clip "word" and inside that MC I created
    a text field
    and gave it an identifier "textFiled".
    2) The linkage name for Movie Clip "word" I set to "word".
    3) In the actionscript I created an Array called "aWords".
    4) Then I created a FOR loop that should
    place (attach) Movie Clips "word0", "word1", "word2" and
    "word3" to the
    movie clip TextPanel, and set the textField text for each of
    them to the
    text from the Array.
    But the script attaches 4 Movie Clips with a name
    "Undefined", instead of 4
    different names (from the Array).
    What is wrong with this script?
    var aWords:Array = [apple,banana,orange,mango];
    for(i=0;i<aWords.length;i++){
    var v = TextPanel.attachMovie("word","word"+i,i);
    v.textFiled.text = aWords
    v._x = randomNumber(0,Stage.width);
    v._y = randomNumber(0,Stage.height);
    Thanks in advance

    But in my Post I already wrote v.textFiled.text = aWords
    so I don't understand what were you correcting..
    And one more:
    I have tested it by changing the
    v.textFiled.text = aWords; to v.textFiled.text = "some
    word";
    and it's working fine.
    So there is something wrong with the Array element, and I
    don't know why..
    "aniebel" <[email protected]> wrote in
    message
    news:ft2d5k$lld$[email protected]..
    > Change:
    > v.textFiled.text = aWords;
    >
    > to:
    > v.textFiled.text = aWords
    >
    > It needs to know which element inside the array you want
    to place in the
    > textfield (or textfiled) :)
    >
    > If that doesn't work, double check that your instance
    name is correct
    > inside
    > of "word".
    >

  • Please help with script for 3D object

    Hi!
    I have PDF file with simple 3d object (for example a cube).
    I need to make script that when user right-click to this cube, some PDF file (c:\mypdf.pdf) opening in new windows. How to make it? Thank you so much!

    Hi!
    I have PDF file with simple 3d object (for example a cube).
    I need to make script that when user right-click to this cube, some PDF file (c:\mypdf.pdf) opening in new windows. How to make it? Thank you so much!

  • Please help with Specs for Elements 10

    Its been so difficult to get to the detailed specs for Elements 10
    Can anyone tell me if it does the following
    1. Import raw data from a Panasonic X5?
    2. Adjust vibrancy directly?
    3. Add starburst effect like in this photo
    Thanks

    See this Adobe document for the latest Adobe Camera RAW (ACR) update:
    http://www.adobe.com/support/downloads/detail.jsp?ftpID=5371
    The "ReadMe" link lists the supported cameras.  (The DMC-LX5 is supported.)
    Yes, a RAW file will open directly in ACR, and JPGs can be opened in ACR by using File...Open As.
    No.  You'll need to find a plug-in that does starbursts.
    Ken
    P.S.,  Barbara, once again, my slow typing did me in....

  • Help with Buttons for Slideshow

    I'm working on my first flash project.  I have created a simple 4 image slideshow.  I have created 4 Buttons that when clicked, jump to that image in the timeline.  I have added Rollover States to the button. Everything is working like I want it to.
    My question is how can I get the buttons to have a different look when that particular image is active?
    Example.  When the slideshow is on the 2nd image, I want Button 2 to have an active state (look different than the other three buttons).
    Here is my project file.
    Thanks

    you have to use movieclip buttons.

  • Please help with code for a program

    Write a program which comutes the value of an investment over a 5 year period.The porgrm should display the value of an investment for each of the 5years were the initial investment and interest rate are to be specified by the user.It should compute and present value in the first year,compute and display value for the second year up to the last year(use a while or do...while loop).While there are more years to process ask the user for the next input,compute the value for the next year and output.

    jverd wrote:
    So what you're saying is that you're a lazy, stupid, unethical cheater and you want someone else to do your homework for you so that you can take credit you don't deserve and get a grade you didn't earn.
    Go to hell.But he's willing to pay big bucks (10 duke stars!) for this, so let's race to get those precious dukes.

  • I made a card using the iPhoto and when I click to buy it, it says that I did not fill all the frames with pictures, even though I did and have checked multiple times. Please help, it's for Mother's Day.

    I made a card using the iPhoto and when I click to buy it, it says that I did not fill all the frames with pictures and that I need to in order to purchase it, even though I did and have checked multiple times. Please help, it's for Mother's Day.

    Before ordering your book preview it using this method - http://support.apple.com/kb/HT1040 - and save the resulting PDF for reference - the delivered book will match it.
    LN

  • HT3209 Purchased DVD in US for Cdn viewing. Digital download will not work in Cda or US? please help with new Digital code that will work

    Purchased DVD in US for Cdn viewing. Digital download will not work in Cda or US? please help with new Digital code that will work

    You will need to contact the movie studio that produced the DVD and ask if they can issue you a new code valid for Canada. Apple cannot help you, and everyone here in these forums is just a fellow user.
    Regards.

Maybe you are looking for