getting following  error: incompatible types: vmpr cannot be converted to JFrame

JFrame VendingMachine = new vmpr();

        import java.awt.Container;
        import java.awt.event.ActionEvent;
        import java.awt.event.ActionListener;
        import javax.swing.JButton;
        import javax.swing.JLabel;
        import java.awt.*;
        import javax.swing.*;
        import javax.swing.JFrame;



        public class vmgu extends JFrame implements ActionListener {
            public JButton button[];
            public JLabel label;
            public JLabel label2;

            public vmpr Machine = new vmpr();

            public vmgu(){


                button=new JButton[12];
                label=new JLabel("balance"+ Machine.getbalance());
                label2=new JLabel("vmachine");
                JFrame myFrame=new JFrame();
                Container pane = getContentPane(); // Get the pane.
                pane.setLayout(new GridLayout(7,2));
                for (int i=0;i<6; i++)
                {
                    Machine.initialize();
                    button[i]= new JButton(Machine.getdesc(i) +" - " + Machine.pr(Machine.getprice(i)));

                }




             button[6]= new JButton ("Dollar");
             button[7]=new JButton("half dollar");
             button[8]=new JButton("quarter");
             button[9]=new JButton("dime");
             button[10]=new JButton("nickel");
             button[11]=new JButton("coinreturn");



             for (int i=0; i<6; i++){

                   button[i].addActionListener(this);
                     button[i+6].addActionListener(this);

             pane.add(label);
             pane.add(label2);
                     pane.add(button[i]);
                     pane.add(button[i+6]);
             }

            }

              public void actionPerformed(ActionEvent event){
                  boolean success;
                  Object tbutton=event.getSource();
                  Machine.initialize();
                  for(int i=6; i<12; i++){
                      if(tbutton==button[i]){


                      switch(i){
                          case 6:
                              Machine.addmoney(100);
                              break;

                          case 7:
                              Machine.addmoney(50);
                              break;
                          case 8:
                              Machine.addmoney(25);
                              break;
                          case 9:
                              Machine.addmoney(10);
                              break;
                          case 10:
                              Machine.addmoney(5);
                          case 11:
                              Machine.getprbalance();

                      }

                  }
                  }
                  for (int i=0; i<6; i++){

                      if (tbutton==button[i]){
                          success=Machine.buyitem(i);
                          Machine.getchange();

                          }
                      }

                    label.setText("balance"+ vmpr.getprbalance());

                  }


        public static void main(String args[]) {

                BuildMachine();
        }
            public static void BuildMachine() {
                JFrame VendingMachine = new vmpr();
                VendingMachine.show(); 
                }

        } 


        public class vmpr  {


            final static int pr0=105;
            final static int pr1=120;
            final static int pr2=150;
            final static int pr3=160;
            final static int pr4=170;
            final  static int pr5=180;


            final static String des0="pepsi";
            final static String des1="cocke";
            final static String des2="dipepsi";
            final static String des3="7up";
            final static String des4="drpepper";
            final static String des5="canadadry";

         public static int balance;

         public static int prices[]=new int[6];
         public static String desc[]=new String[6];

         public static void setprice(int itemno, int price){

             prices[itemno]=price;
         }

         public static void setdesc(int itemno, String des){
             desc[itemno]=des;

         }
        public static int getprice(int price){
            return prices[price];
        }
        public static String getdesc(int itemno){
            return desc[itemno];
        }


        public static void setbalance(int Balance){
            balance=Balance;
        }
        public static int getbalance(){
            return balance;
        }


        public static void addmoney(int money){
            balance=money+balance;
        }

        public boolean buyitem(int item){
            boolean tr;

        if (balance < getprice(item))
        {
            System.out.println("not enough funds");
            tr=false;
        }

        else
        {
            balance-=getprice(item);
            System.out.println("purchase successfully");

            tr=true;
        }
        return tr;

        }


        public static void initialize(){
            setdesc(0,des0);
            setdesc(1,des1);
            setdesc(2,des2);
            setdesc(3,des3);
            setdesc(4,des4);
            setdesc(5,des5);

            setprice(0,pr0);
            setprice(1,pr1);
            setprice(2,pr2);
            setprice(3,pr3);
            setprice(4,pr4);
            setprice(5,pr5);

        }

        public static void getchange(){

        int dollars=0;
        int halfdollars=0;
        int quarter=0;
        int dime=0;
        int nickel=0;
        int total=getbalance();

        dollars=total/100;
        total-=(dollars*100);

        halfdollars=total/50;
        total-=(halfdollars*50);

        quarter=total/25;
        total-=(quarter*25);

        dime=total/10;
        total-=(dime*10);

        nickel=total/5;
        total-=(nickel*5);

        }


        public static String getprbalance(){
            return pr(balance);

        }
        public static String pr(int amount){

            int dollars=0;
            int cents=0;
            int tens=0;
            int ones=0;
            String as=null;


            dollars=amount/100;

                cents = amount % 100; // This gets the remainer, or how many cents are left.
                // Now get the Ten's and One's places from this "Cents".
                tens = cents / 10; // This gets the tens place of our total.
                ones = cents % 10; // This gets the ones place of our total.
                // Create our pretty String that has the format: "$X.XX"
                as = "$" + dollars + "." + tens + ones;
            return as;

        }

        }

That message says it all. Why did you think that your vmpr object would be a JFrame?

your vmgu class extends JFrame, vmpr doesn't.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.