Re: School Project Help, can't find symbol error.

double tentaBill = iWhat's i?

It's in computeTentativBil method, i'm trying to return a value to main and "i" and set it to tentaBill, then pass tentabill to the next method.
  public static double computeTentativeBill(Order theOrder)
         double totalExtreme;
         double totalModerate;
         double totalMinor;
         double i;
         double extremeCost = 999.99;
         double moderateCost = 499.99;
         double minorCost = 99.99;
         totalExtreme = (theOrder.extreme * extremeCost);
         totalModerate = (theOrder.moderate * moderateCost);
         totalMinor = (theOrder.minor * minorCost);
         i = ((totalExtreme + totalModerate) + totalMinor);
                      // Welcome User To Program
         System.out.println("Your Tentative Bill before Taxes is " +i);     
         return (i);           
     

Similar Messages

  • Please help with cannot find symbol error. Been struggling all day :(

    Hi all. :)
    Writing a game for my phone with KToolbar and have been getting a cannot find symbol error for every variable and method I try to use across Classes. I've looked all over and though it seems a common problem I always either don't understand or can't get working the various solutions. Example of my errors:
    C:\...\BTK800i.java:197: cannot find symbol
    symbol : variable youSayWhat
    location: class HelloCanvas
              youSayWhat=key;
              ^
    If I try BTK800i.variable or BTK800i.message I get a new error.
    C:\...\src\BTK800i.java:184: non-static method newOrdersSarge() cannot be referenced from a static context
              BTK800i.newOrdersSarge();
              ^
    Both these errors apply to both variables and methods. It only happens when I'm using methods/variables of one class in another, am I using public and private incorrectly? It doesn't seem to make a difference if I make variables public or leave them private, I'm trying to get to them with a public method within a private class. Is it something else? I really have no idea. :(
    Here's my code, it's long enough to be a tiresome read so I've tried to skip what I know isn't relevant.
    public class BTK800i extends MIDlet {
         private Display myDisplay;
         private HelloCanvas myCanvas;
         public int youSayWhat;
            //a whole bunch more skipped here, but I'm fairly certain it's not anything that'll help find a solution
         public BTK800i() {
              paused=false;
    public void startApp() throws MIDletStateChangeException {
              if( paused ) {
                   myCanvas.repaint();
              else {
                   myDisplay=Display.getDisplay(this);
                   myCanvas=new HelloCanvas();
                   myDisplay.setCurrent(myCanvas);
                   myCanvas.setFullScreenMode(true);
                   youSayWhat=0;
                           //again with the skipping, more code not related
    public void newOrdersSarge() {
    //whole bunch of code
    //other methods skipped
    class HelloCanvas extends Canvas {
         public void keyPressed (int key) {
              youSayWhat=key;
              repaint ();
    //skippage
    }The stuff I skipped is mainly either more of the same sorta thing or maths/writing to screen stuff.
    Thanks alot to anyone who helps. I'm really struggling with this. :(
    Dan.

    But I have been reading them :(
    My next-door neighbour unfortunately is an 80-something married man, but I will go have a looksie about static and instances.
    I thought the point of public variables was that other classes could use them, is this wrong?
    Also does this mean that to use the variables from my BTK class in the HelloCanvas class I need to first instantiate BTK? I don't understand how that works as the code starts running from the BTK class in the first place :S I guess more reading will help with this.
    Thanks very much for replying. :)
    Edit:
    OK I have read up on it but I don't think I found anything I hadn't read before. I tried to make a new class which I could instantiate to hold all the variables and methods I wanted everything to be able to access, but that went disastrously. Am I right in understanding that there are no global variables in Java? :s
    Edited by: Dan69 on Apr 17, 2010 1:15 PM

  • Can not find symbol error

    I have imported javax.swing.*; and I have a listener for my JList box but when I say impliments ListSelectionListener the compiler says can not find symbol. Can anyone help me on this?

    ListSelectionListener is part of the javax.swing.event package, which is not the same as the javax.swing package.
    http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/event/ListSelectionListener.html

  • Please help. Cannot find symbol Error!

    I have been working on this code for days now. It keeps coming up with errors. The error says cannot find symbol. I will bold the areas that say that. I got it down to 23 from 42 but now I have no idea what the problem is. any help is greatly appreciated!! I only added a couple of them mainly because it is overwhelming. I can add the rest of someone replies. Thank you again. Oh and the Classpath is set right. I am compiling from the desktop where I have the file also. That was the first thing I checked after reading other threads related to this issue. :O)
    import javax.swing.*;
    import java.awt.event.*;
    public class InventoryPart4 extends JFrame
         private JTextArea text;
         private Inventory inv;
         private int view;
         public InventoryPart4() {
              super("Product");
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // quit if the window is closed
              view = 0; // current one showing
              Product product;
              inv = new Inventory(4);
              product = new Product(1, "Salad", 3, 4.95); here
              inv.add(product, 0);
    product = new Product(2, "Dressing", 6, 3.00); here          
    inv.add(product, 1);
    product = new Product(3, "Bacon Bits", 2, 1.75);*here*
              inv.add(product, 2);
    product = new Product(4, "Croutons", 1, 1.75); here
              inv.add(product, 3);
              // sort
              inv.sort();
              // output
              for (int i = 0; i < 4; i++) {
                   System.out.println(inv.get(i));
              // total val
              System.out.printf("Total=$%.2f", inv.totalValue());
              //gui
              JPanel panel = new JPanel();
              panel.setLayout(new BoxLayout(panel,BoxLayout.Y_AXIS));
              text = new JTextArea(10,50);
              text.setEditable(false);
              panel.add(text);
              showProduct();
              JButton next = new JButton("Next");
    here          next.addProduct(new Product() {
                   public void actionPerformed(ActionEvent e) {
                        if (view < inv.size()-1) view++;
                        else view = 0;
                        showProduct();
              panel.add(next);
              getContentPane().add(panel);
         // view an item
         public void showProduct() {
              text.setText("Product Details:\n");
              text.append(inv.get(view).toString()+"\n");
              text.append(String.format
                        ("Value of all the Contents: $%.2f", inv.totalValue()));
         public static void main(String args [])
              InventoryPart4 invt = new InventoryPart4();
              invt.pack();
              invt.setVisible(true);
         } //end main
    } // end class InventoryPart1
    class Product {
    private int ProductItem;
    private int ProductStock;
    private double ProductPrice;
    public Product(int item, int stock, double price) {
    ProductItem = item;
    ProductStock = stock;
    ProductPrice = price;
    } //end three-argument constructor
    // set Product Item
    public void setProductItem(int item) {
    ProductItem = item; here
    } //end method set Product Item
    //return Product Item
    public int getsProductItem() {
    return productItem;
    } //end method get product Item
    //set Product Stock
    public void setProductStock(int stock) {
    productStock = stock;
    } //end method set Product Stock
    //return Product Stock
    public int getProductStock() {
    return productStock;
    } //end method get Product Stock
    public void setProductPrice(double price) {
    productPrice = price;
    } //end method setproductPrice
    //return Product Price
    public double getProductPrice() {
    return ProductPrice;
    } //end method get Product Price
    //calculate inventory value
    public double value() {
    return productPrice * productStock;
    }// end method get productPrice and productStock
    @Override
    public String toString() {
    return String.format("item=%3d units=%d price=%.2f value=%.2f",
    productItem, productStock, productPrice, value());
    }//end class Product
    class Inventory {
         private Product[] list;
         // constructor
         public Inventory(int size) {
              list = new Product[size];
         // complete value
         public double totalValue() {
              double val = 0.0;
              for (int i = 0; i < list.length; i++) {
                   val += list.value();
              return val;
         // add an item
         public void add(Product i, int p) {
              list[p] = i;
         // get an item
         public Product get(int i) {
              return list[i];
         // sort by name
         public void sort() {
              // bubble sort
              int n = list.length;
              for (int search = 1; search < n; search++) {
                   for (int i = 0; i < n-search; i++) {
                        if (list[i].getProductItem().compareToIgnoreCase(list[i+1].getProductItem()) > 0) {
                             // swap
                             Product temp = list[i];
                             list[i] = list[i+1];
                             list[i+1] = temp;
         public int size() {
              return list.length;
    //extended class
    class Contents extends Product {
         private String Contents;
         // constructor
         public Contents(int item, String name, int units, double price) {
              super(item,name,units, price);
              this.contents = contents;
         // getter
         public String getContents() {
              return Contents;
         // total value with the 5% fee
         public double value() {
              return super.value()*1.05;
         // just the 5% fee
         public double fee() {
              return super.value()*0.05;
         // setter
         public void setContents(String contents) {
              this.contents = contents;
         public String toString()
              return super.toString() + String.format(" fee=%.2f contents=%-20s",
                        fee(), contents);

    The error says cannot find symbol.It says more than that. It says what symbol it cannot find, and it points to the line of code where the symbol was used.
              product = new Product(1, "Salad", 3, 4.95); *here*So it can't find a class called Product with an accessible constructor Product(int, String, int, double).
    product = new Product(2, "Dressing", 6, 3.00); *here*          
    inv.add(product, 1);
    product = new Product(3, "Bacon Bits", 2, 1.75);*here*
              inv.add(product, 2);
    product = new Product(4, "Croutons", 1, 1.75); *here*
              inv.add(product, 3);Ditto.
              JButton next = new JButton("Next");
    *here*          next.addProduct(new Product() {JButton doesn't have an addProduct() method.
    public Product(int item, int stock, double price) {This constructor doesn't match the constructor you are calling above, and there are no other constructors.
    ProductItem = item; *here*You must have a typo. But don't use inital capitals on field names: use them only on class names.
    return productItem;Here is evidence that you have a typo. Java is case-sensitive. Either the field is caled 'ProductItem' or it is called 'productItem', not both.
              // bubble sortDo you have to do this for the homework? Bubble sort is never used in real code except by people who don't know what they're talking about. Use Collections.sort().
              super(item,name,units, price);You should be getting a compile error here too. Ther is no such constructor for Product.
              return Contents;And here.

  • Help with 'cannot find symbol' error

    Ive written the following code. It is an excerpt from my entire class.
    When I try to compile the code I get the error:-
    cannot find symbol
    Symbol: variable playerRun1
    location: this class
    public void analysePlayerMove()
              if (playerGo == true)
                   if (playerMove.getComponentCount() == 0)
                        JOptionPane.showMessageDialog(this, "You Have Not Made A Move", "Empty Move", JOptionPane.ERROR_MESSAGE);
                   else
                        if (areTherePickUps == false)
                             for (int j=0; j<playerMove.getComponentCount(); j++)
                                  //reversing the players hand, because what is displayed on the GUI is reversed
                                  Component[] playerRun = playerMove.getComponentsInLayer(playerMove.DEFAULT_LAYER);
                                  Component[] playerRun1 = new Component[playerRun.length];
                                  int reverse = playerRun.length-1;
                                  for (int k=0; k<playerRun.length; k++)
                                       playerRun1[k] = playerRun[reverse];
                                       reverse--;
                             if (acePlayed == true && playerRun1.length == 1)
                                  if (playerRun1[0] != acePlayedSuit)
                                       JOptionPane.showMessageDialog(this, "Your Move Is Not Valid", "Invalid Move", JOptionPane.ERROR_MESSAGE);
                                  else
                                       //remove the cards from the players move hand and add them to the bottom of the shredded deck
         }I dont understand why I am getting this error, I clearly define the variable.

    Yes, but the variable is declared inside a block and so it's local to that block. You can't use it outside its scope, which is the block in which you declared it. Re-read the section of your book about variable scope.

  • HELP - 'Can't find class' error

    I have just bought a new computer with Windows XP and downloaded and installed the new versions of the jdk, jre, etc.
    I have written the Hello World program to check that everything works. It compiles fine, but when I try to run I get an error - Can't find class helloworld - and then it exits.
    I know that the path variable is set correctly and I used to have to set the classpath as well, but have been told that this is not necessary.
    I really need to get this working as have some important programming to do.
    Thanks for any help,
    Olly

    Try this;-
    prompt>set CLASSPATH=
    .......> return key
    prompt>java helloWorld
    Hello World!
    prompt>
    AMAZING!
    This works fine. Thanx.
    Is there any way to set it so that I dont have to do
    the set classpath stuff each time I run a program
    though?
    CheersWell, set a system variable
    CLASSPATH=.;<java_home>\jre\lib\rt.jar
    regardws, Thomas

  • Can't find symbol error with registerFont() - why?

    I am using the following code which is essentially the same as I copied from a post of someone for whom it apparently works. I am using JDK6 and Netbeans.
    No matter what I do the line containing registerFont() causes Netbeans to flag it with the following error message:
    cannot find symbol
    symbol : method registerFont(java.awt.Font)
    location: class java.awt.GraphicsEnvironment
    Here is the code. What do I need to do to get rid of this error?
    Thanks!
    import java.awt.Font;
    import java.awt.FontFormatException;
    import java.awt.GraphicsEnvironment;
    import java.io.IOException;
    import java.io.InputStream;
    import java.net.URL;
    import java.net.URLConnection;
    public class FontLoad {
    public Font downloadFont(String filename) throws IOException, FontFormatException{
    URL serverStream=new URL("xxxxxxxxxxxx.com");
    URLConnection uc=serverStream.openConnection();
    System.out.println("Connection established. Downloading font...");
    uc.setDoInput(true);
    InputStream is=serverStream.openStream();
    Font font=Font.createFont(Font.TRUETYPE_FONT, is);
    GraphicsEnvironment.getLocalGraphicsEnvironment().registerFont(font); // <-----
    System.out.println("Font downloaded.");
    is.close();
    System.out.println("Connection closed.");
    font=font.deriveFont(45);
    font=font.deriveFont(Font.PLAIN);
    return font;
    }

    Addirional note: This is a java class within a JavaFX application if that is relevant.
    It does seem to be relevant - if I create the same class as part of a Java application rether than a JavaFX application it compiles without error. Is the imported java.awt.GraphicsEnvironment different in the tow cases??
    Edited by: Sidereal on Aug 28, 2009 11:19 AM

  • Cant find symbol error

    why am i getting this "can't find symbol error" in relation to class Function?
    import javax.swing.JOptionPane;
    public class MYPA5
         public static void main ( String [] args )
              Function myF = new Function( );
              double Func1 = myF.getSum( );
    class Functinon
         double x;
         String coeffa = JOptionPane.showInputDialog( null, "Give the first Coefficient");
       double a = Double.parseDouble(coeffa);
         String coeffb = JOptionPane.showInputDialog( null, "Give the second Coefficient");
         double b = Double.parseDouble(coeffb);
         String coeffc = JOptionPane.showInputDialog( null, "Give the third Coefficient");
         double c = Double.parseDouble(coeffc);
         String coeffd = JOptionPane.showInputDialog( null, "Give the fourth Coefficient");
         double d = Double.parseDouble(coeffd);
         double sum = a*Math.pow(x,0) + b*Math.pow(x,1) + c*Math.pow(x,2) + d*Math.pow(x,3);
         public double getSum( )
              return sum;
    }

    Just guessing here...
    Because you named it Functinon instead of Function? (but that may just be a typo in your question of course)
    or because it is not public and not in the same package as MYPA5?

  • Help - cannot find symbol error

    Can someone help me? I am getting "cannot find symbol" error in my code and cannot figure out why. Here is my code:
    public class toyInventory
    private String[] toyInventory = {"ball", "bat", "bear", "car", "doll", "game", "glove", "playstation", "train"};
    private int[] nineArray = {0,0,0,0,0,0,0,0};
    int invItems = 0;
    public void countToy()
    String orderInput[] = {"bear", "train", "car", "ball", "doll", "ball", "train", "doll", "game", "train", "bear", "doll", "train", "car", "ball", "bat", "glove", "bat", "b", "doll", "bear", "ball", "doll", "bat", "car", "glove", "train", "doll", "bear"};
    int noMatch;
    for(int a = 0; a < orderInput.length; a++)
    noMatch = 0;
    for(int b = 0; b < toyInventory.length; b++)
    if(orderInput[a] == toyInventory)
    noMatch = 1;
    break;
    if(noMatch == 0)
    invItems = 1;
    public void printItems()
    for(int c = 0; c < toyInventory.length; c++)
    if (countToy[c] > 4)<-------- cannot find symbol error here
    System.out.print("*");
    System.out.print(toyInventory[c] + "\t" + countToy[c] + "\n"); <----cannot find symbol error here also
    System.out.print("The number of invalid items in the order is" + invItems);
    public static void main( String[] args)
    toyInventory collection = new toyInventory ();
    collection.countToy();
    collection.printItems();

    public void countToy()
    String orderInput[] = {"bear", "train", "car", "ball", "doll", "ball", "train", "doll", "game", "train", "bear", "doll", "train", "car", "ball", "bat", "glove", "bat", "b", "doll", "bear", "ball", "doll", "bat", "car", "glove", "train", "doll", "bear"};In the above code you have declared countToy() as method and while in the below lines you are calling countToy[] as an array. So please check that...
    if (countToy[c] > 4)<-------- cannot find symbol error here
    System.out.print("*");
    System.out.print(toyInventory[c] + "\t" + countToy[c] + "\n"); <----cannot find symbol error here also
    }

  • How can i find my errors during project validation before burning my project

    How Can I find the errors during the project validation before burning the project??

    Follow this workflow to help assure the best qualty video DVD:
    Once you have the project as you want it save it as a disk image via the File ➙ Save as Disk Image  menu option. This will separate the encoding process from the burn process. 
    To check the encoding mount the disk image, launch DVD Player and play it.  If it plays OK with DVD Player the encoding is good.
    Then burn to disk with Disk Utility or Toast at the slowest speed available (2x-4x) to assure the best burn quality.  Always use top quality media:  Verbatim, Maxell or Taiyo Yuden DVD-R are the most recommended in these forums.
    OT

  • HT3775 I get the following message when trying to open an .avi downloaded from my video cam, need help, can not find the codec, thank you.The document "IMAG0026.AVI" could not be opened. A required codec isn't available.

    I get the following message when trying to open an .avi downloaded from my video cam, need help, can not find the codec, thank you. This is for Quicktime Player.
    "The document “IMAG0026.AVI” could not be opened. A required codec isn't available."

    Try Perian.
    http://perian.org/

  • Need help with class info and cannot find symbol error.

    I having problems with a cannot find symbol error. I cant seem to figure it out.
    I have about 12 of them in a program I am trying to do. I was wondering if anyone could help me out?
    Here is some code I am working on:
    // This will test the invoice class application.
    // This program involves a hardware store's invoice.
    //import java.util.*;
    public class InvoiceTest
         public static void main( String args[] )
         Invoice invoice1 = new Invoice( "1234", "Hammer", 2, 14.95 );
    // display invoice1
         System.out.println("Original invoice information" );
         System.out.println("Part number: ", invoice1.getPartNumber() );
         System.out.println("Description: ", invoice1.getPartDescription() );
         System.out.println("Quantity: ", invoice1.getQuantity() );
         System.out.println("Price: ", invoice1.getPricePerItem() );
         System.out.println("Invoice amount: ", invoice1.getInvoiceAmount() );
    // change invoice1's data
         invoice1.setPartNumber( "001234" );
         invoice1.setPartDescription( "Yellow Hammer" );
         invoice1.setQuantity( 3 );
         invoice1.setPricePerItem( 19.49 );
    // display invoice1 with new data
         System.out.println("Updated invoice information" );
         System.out.println("Part number: ", invoice1.getPartNumber() );
         System.out.println("Description: ", invoice1.getPartDescription() );
         System.out.println("Quantity: ", invoice1.getQuantity() );
         System.out.println("Price: ", invoice1.getPricePerItem() );
         System.out.println("Invoice amount: ", invoice1.getInvoiceAmount() );
    and that uses this class file:
    public class Invoice
    private String partNumber;
    private String partDescription;
    private int quantityPurchased;
    private double pricePerItem;
         public Invoice( String ID, String desc, int purchased, double price )
              partNumber = ID;
         partDescription = desc;
         if ( purchased >= 0 )
         quantityPurchased = purchased;
         if ( price > 0 )
         pricePerItem = price;
    public double getInvoiceAmount()
         return quantityPurchased * pricePerItem;
    public void setPartNumber( String newNumber )
         partNumber = newNumber;
         System.out.println(partDescription+" has changed to part "+newNumber);
    public String getPartNumber()
         return partNumber;
    public void setDescription( String newDescription )
         System.out.printf("%s now refers to %s, not %s.\n",
    partNumber, newDescription, partDescription);
         partDescription = newDescription;
    public String getDescription()
         return partDescription;
    public void setPricePerItem( double newPrice )
         if ( newPrice > 0 )
    pricePerItem = newPrice;
    public double getPricePerItem()
    return pricePerItem;
    Any tips for helping me out?

    System.out.println("Part number:
    "+invoice1.getPartNumber;
    The + sign will concatenate invoice1.getPartNumber()
    after "Part number: " forming only one String.I added the plus sign and it gives me more errors:
    C:\>javac InvoiceTest.java
    InvoiceTest.java:16: operator + cannot be applied to java.lang.String
            System.out.println("Part number: ",   + invoice1.getPartNumber() );
                                                  ^
    InvoiceTest.java:17: cannot find symbol
    symbol  : method getPartDescription()
    location: class Invoice
            System.out.println("Description: ", + invoice1.getPartDescription() );
                                                          ^
    InvoiceTest.java:17: cannot find symbol
    symbol  : method println(java.lang.String,int)
    location: class java.io.PrintStream
            System.out.println("Description: ", + invoice1.getPartDescription() );
                      ^
    InvoiceTest.java:18: cannot find symbol
    symbol  : method getQuantity()
    location: class Invoice
            System.out.println("Quantity: ", + invoice1.getQuantity() );
                                                       ^
    InvoiceTest.java:18: cannot find symbol
    symbol  : method println(java.lang.String,int)
    location: class java.io.PrintStream
            System.out.println("Quantity: ", + invoice1.getQuantity() );
                      ^
    InvoiceTest.java:19: cannot find symbol
    symbol  : method println(java.lang.String,double)
    location: class java.io.PrintStream
            System.out.println("Price: ", + invoice1.getPricePerItem() );
                      ^
    InvoiceTest.java:20: cannot find symbol
    symbol  : method println(java.lang.String,double)
    location: class java.io.PrintStream
            System.out.println("Invoice amount: ", + invoice1.getInvoiceAmount() );
                      ^
    InvoiceTest.java:24: cannot find symbol
    symbol  : method setPartDescription(java.lang.String)
    location: class Invoice
            invoice1.setPartDescription( "Yellow Hammer" );
                    ^
    InvoiceTest.java:25: cannot find symbol
    symbol  : method setQuantity(int)
    location: class Invoice
            invoice1.setQuantity( 3 );
                    ^
    InvoiceTest.java:30: operator + cannot be applied to java.lang.String
            System.out.println("Part number: ", + invoice1.getPartNumber() );
                                                ^
    InvoiceTest.java:31: cannot find symbol
    symbol  : method getPartDescription()
    location: class Invoice
            System.out.println("Description: ", + invoice1.getPartDescription() );
                                                          ^
    InvoiceTest.java:31: cannot find symbol
    symbol  : method println(java.lang.String,int)
    location: class java.io.PrintStream
            System.out.println("Description: ", + invoice1.getPartDescription() );
                      ^
    InvoiceTest.java:32: cannot find symbol
    symbol  : method getQuantity()
    location: class Invoice
            System.out.println("Quantity: ", + invoice1.getQuantity() );
                                                       ^
    InvoiceTest.java:32: cannot find symbol
    symbol  : method println(java.lang.String,int)
    location: class java.io.PrintStream
            System.out.println("Quantity: ", + invoice1.getQuantity() );
                      ^
    InvoiceTest.java:33: cannot find symbol
    symbol  : method println(java.lang.String,double)
    location: class java.io.PrintStream
            System.out.println("Price: ", + invoice1.getPricePerItem() );
                      ^
    InvoiceTest.java:34: cannot find symbol
    symbol  : method println(java.lang.String,double)
    location: class java.io.PrintStream
            System.out.println("Invoice amount: ", + invoice1.getInvoiceAmount() );
                      ^
    16 errors

  • Help! Getting the cannot find symbol error.

    Hello everyone. I have gone throught my whole program and I am still getting a cannot find symbol error. What does this error mean exactly? Here is the code below. I am trying to color a background using a comobox method.
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.ButtonGroup;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.border.EtchedBorder;
    import javax.swing.border.TitledBorder;
    import java.awt.GridLayout;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import javax.swing.JComboBox;
    public class ComboboxFrame extends JFrame
        public ComboboxFrame()
            colorPanel = new JPanel();
            colorPanel.setPreferredSize(new Dimension(PANEL_WIDTH, PANEL_HEIGHT));
            getContentPane().add(colorPanel, BorderLayout.CENTER);
            class ChoiceListener implements ActionListener
                public void actionPerformed(ActionEvent event)
                    setbackgroundColor();
            listener = new ChoiceListener();
            createControlPanel();
            setbackgroundColor();
            pack();
        private void createControlPanel()
          JPanel colorPanel = createComboBox();
          JPanel controlPanel = new JPanel();
          controlPanel.setLayout(new GridLayout(1, 1));
          controlPanel.add(colorPanel);
          getContentPane().add(
             controlPanel, BorderLayout.SOUTH);
       public JPanel createComboBox()
          colorCombo = new JComboBox();
          colorCombo.addItem("Red");
          colorCombo.addItem("Green");
          colorCombo.addItem("Blue");
          colorCombo.setEditable(true);
          colorCombo.addActionListener(listener);
          JPanel panel = new JPanel();
          panel.add(colorCombo);
          return panel;
       public void setbackgroundColor()
           String color = (String)colorCombo.getSelectedItem();
           colorPanel.setbackgroundColor(new backgroungColor(color));
           colorPanel.repaint();
       private JPanel colorPanel; 
       private static final int PANEL_WIDTH = 300;
       private static final int PANEL_HEIGHT = 300;
       private JComboBox colorCombo;
       private ActionListener listener;
    }The line with the error is: colorPanel.setbackgroundColor(new backgroungColor(color));
    Here is the second file
    import javax.swing.JFrame;
    public class backgroundTest
        public static void main(String[] args)
            JFrame frame = new comboboxFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.show();
    }Any help would be appreciated. Thank you

    Hello everyone. I have gone throught my whole
    program and I am still getting a cannot find symbol
    error. "Symbol" here means variable or method name (or maybe class name, but I think it will specifically bitch about classnames in that case).
    String foo = "foo";
    System.out.println(zoo); // no such variable as zoo. So...
    colorPanel.setbackgroundColor(new backgroungColor(color));Looks like colorPanel or setbackgroundColor(new backgroungColor doesn't exist.
    Note that spelling and capitalization count. Java's really anal that way.

  • When I try to open my project, where can I find the requested file 00000.mts2?

    When I try to open my project, I am asked where to find file 00000.mts2?
    I see almost all scenes in my project in color red  with the text 'media off-line'. But it is impossible to find this requested file 00000.mts2 on my computer. What can I do to solve this problem?
    Thank you for your answer.
    Hans

    Thank you. I have done what you told me. It was a long search, but at the end I was succesful. Again: thank you for your useful answer.
    Greetings,
    Hans
    Verstuurd vanaf mijn iPad
    Op 26 feb. 2015 om 00:29 heeft Peru Bob <[email protected]> het volgende geschreven:
    When I try to open my project, where can I find the requested file 00000.mts2?
    created by Peru Bob in Photoshop Elements - View the full discussion
    This is the Photoshop Elements forum.  Are you using Premiere Elements? If so, ask here:
    Premiere Elements
    By the way, if you moved your media files or they are on an external drive, you will have to relink them.
    If the reply above answers your question, please take a moment to mark this answer as correct by visiting: https://forums.adobe.com/message/7230757#7230757 and clicking ‘Correct’ below the answer
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    Please note that the Adobe Forums do not accept email attachments. If you want to embed an image in your message please visit the thread in the forum and click the camera icon: https://forums.adobe.com/message/7230757#7230757
    To unsubscribe from this thread, please visit the message page at , click "Following" at the top right, & "Stop Following"
    Start a new discussion in Photoshop Elements by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to https://forums.adobe.com/thread/1516624.

  • Can not find symbol

    i am wrting a bean which has methods and i am passing that bean
    object to the method of another class but when i compile the second class i get the error can not find symbol and the method name of bean
    which i want to acces in second class.

    i a using Role.java bean in RoleManager.java the files are as follows
    and when compiling the RoleManager.java i get the above error by showing method getOrderby() can not find symbol
    /******** Role.java (bean class) ************************/
    package com.tattva.pms.employee;
    import java.beans.*;
    public class Role implements java.io.Serializable
    /** Holds value of property code. */
    private String code;
    /** Holds value of property type. */
    private String type;
    /** Holds value of property description. */
    private String description;
         /** Holds value of property orderby */
         private String orderby;
    /** Creates new Role */
    public Role() {
    /** Getter for property code.
    * @return Value of property code.
    public String getCode() {
    return code;
    /** Setter for property code.
    * @param code New value of property code.
    public void setCode(String code) {
    this.code = code;
    /** Getter for property type.
    * @return Value of property type.
    public String getType() {
    return type;
    /** Setter for property type.
    * @param type New value of property type.
    public void setType(String type) {
    this.type = type;
    /** Getter for property description.
    * @return Value of property description.
    public String getDescription() {
    return description;
    /** Setter for property description.
    * @param description New value of property description.
    public void setDescription(String description) {
    this.description = description;
         /** Getter for property code.
    * @return Value of property code.
    public String getOrderby() {
    return orderby;
    /** Setter for property code.
    * @param code New value of property code.
    public void setOrderby(String orderby) {
    this.orderby = orderby;
    /****************************RoleManager.java*************************
    package com.tattva.pms.employee;
    import com.tattva.pms.employee.*;
    //package com.tattva.pms.dept;
    import com.tattva.pms.database.*;
    //import com.tattva.pms.dept.*;
    import java.sql.*;
    import java.util.*;
         * Insert the type's description here.
         * Creation date: (5/22/02     1:53 PM)
         * @author: Sachin Bhansali
    //public class DeptManager
    public class RoleManager
         * The Declaration of the fields
         * to be used.
         * Decleration of Global variables
    //private ConnectionPool ovPool = null;
    //     private QueryManager ovQuery     = null;
         //private ResultSet ovResultSet     = null;
         private int rowCount          = 0;
    /** Creates new DeptManager */
    // public DeptManager()
         public RoleManager()
              super();
         * Creates new JobDtlManager
         * Commented constructor
    /* public DeptManager(ConnectionPool conPool)throws SQLException{
    ovPool = conPool;
    ovQuery = new QueryManager(ovPool);
    conPool = null;
         * throws exception PMSException and the general Exception
         * @param DeptBean contaning the details.
         // public int addDept(DeptBean dept)throws PMSException, Exception
         public int addRole(Role role)throws PMSException,Exception
              ConnectionPool ovPool = null;
              Connection ovCon = null;
              Statement ovStmt = null;
    String sqlStr = null;
    // The SQL query String
         /*     sqlStr = "Insert into DEPARTMENT_MST Name (V_CODE,V_NAME,V_LOCATION,V_FUNCTIONALITY, V_CREATED_BY) values ('"
                             + dept.getDeptCode() +"','" + dept.getDeptName() + "','" + dept.getDeptLoc() + "','" + dept.getDeptFun() +
                             "','" dept.getCreatedBy()"')";
         sqlStr = "Insert into ROLE_MST Name (V_CODE,V_TYPE,V_DESCRIPTION,N_ORDERBY) values "+
                        "('"+role.getCode()+"','"+role.getType()+"','"+role.getDescription()+"','"+role.getOrderby()+"')";
    //start of try block
                   try{
                        ovPool = new ConnectionPool();
                   // ovCon = ovPool.createConnection("DeptManager: addDept(DeptBean dept)");
                        ovCon = ovPool.createConnection();
                   ovStmt = ovCon.createStatement();
                        rowCount = ovStmt.executeUpdate(sqlStr);
                   return 0;
                   }catch(PMSException pmsEx){
                        throw pmsEx;
                   }catch(SQLException sqlEx){
    return sqlEx.getErrorCode();
                   }catch(Exception e){
                        //throw new PMSException("addJob() SQLException Wrapped! " + e.getMessage());
                        throw new PMSException("addRole() SQLException Wrapped! " + e.getMessage());
                   }finally{     
                        role=null;
                                  //dept = null;
                                  if(ovStmt != null)
    ovStmt.close();
                                  ovStmt =null;
                                  ovPool.close(ovCon);
    ovCon = null;
                                       ovPool =null;
    //end of try block
    }

Maybe you are looking for

  • How to transfer files Pages docs in bulk from iPad to Mac

    Since the lovely iCloud Drive came out and Yosemite, things have been woefully out of sync with my iPad.  I've posted in a number of places on these boards and even, according to a rep I've been in touch with from Apple Support, an engineer is troubl

  • Wireless Network/printing Newbie Questions....

    Okay, first of all I love Airport and OSX Tiger on my new MacBook. I recieve a strong wireless internet connection in my Los Angeles apartment, and I have NO idea where it's coming from! (my neighbors? The police station across the street,? Just in t

  • Application Builder Issue

    I am totally new at this so please excuse my ignorance. I am trying to build a tabular form application. From what I read from the screen, a tabular form should allow the ability to create new records as well as update existing records. When I run th

  • Mapping trouble

    Hi all, Iam stuck with a  mapping problem and need Help!!! :). Would be grateful if someone could give me a hand on this. In The picture depicted below is the first problem: http://i42.tinypic.com/2epn3lt.jpg For Every occurance of "E1EDPT1",I want t

  • KDE4 Cannot log out ,reboot, shut down

    I using kde from svn and xorg from git. Before updating xorg all works fine.Now when I click on logout/reboot/shut down button nothing happen. What log should I attach to give more information ?