Results 1 to 2 of 2
  1. #1
    cuddles14 is offline Member
    Join Date
    Mar 2011
    Posts
    2
    Rep Power
    0

    Post Help about doing GUI in sales and inventory program.

    Hey there! Im done bout the functions of my program and now, I need to make my 2 Classes and a GUI for my program. I dont have any idea about making a GUI and 2 classes. please help me. below are my codes. (sorry bout some filipino words that i used.)

    package salesandInventory;

    import javax.swing.*;

    public class Sales {
    public static void main(String[]args){

    int put=0;
    int choose=0;
    int buy=0;
    double payment=0;
    double bayad=0;
    double change=0;
    int dagdag=0;
    int dagdag1=0;
    double a=0,b=0;

    {
    do{
    do{

    choose = Integer.parseInt(JOptionPane.showInputDialog(null, "Your One Stop Paint Shop\n\n"+
    " [101]Red Boysen Paint 1 Litter - P600\n [102]Blue Boysen Paint 1 Litter - P650 [103]Green Boysen Paint 1 Litter- P620\n [104]White Boysen Paint 1 Litter - P500\n [105]Yellow Boysen Paint 1 Litter - P700\n"+
    " [106]Pink Boysen Paint 1 Litter - P660\n [107]Rainbow Boysen Paint 1 litter - P800\n [108]Violet Boysen Paint 1 Litter - P700\n [109]Maroon Boysen Paint 1 Litter - P620\n [1010]Kulay Kalawang Boysen Paint 1 Litter - P780\n [00]Exit And Display Sales Transactions"));//statement ng choices
    if(choose==101)//statement kung san mag input ng item code
    {
    buy = Integer.parseInt(JOptionPane.showInputDialog(null, "How Many Red Boysen Paint You Want to Buy?"));
    payment = buy*600;
    dagdag=0;
    }
    else if(choose==102)
    {
    buy = Integer.parseInt(JOptionPane.showInputDialog(null, "How Many Blue Boysen Paint You Want to Buy?"));
    payment = buy*650;
    dagdag=0;
    }
    else if(choose==103)
    {
    buy = Integer.parseInt(JOptionPane.showInputDialog(null, "How Many Green Boysen Paint You Want to Buy?"));
    payment = buy*620;
    dagdag=0;
    }
    else if(choose==104)
    {
    buy = Integer.parseInt(JOptionPane.showInputDialog(null, "How Many White Boysen Paint You Want to Buy?"));
    payment = buy*500;
    dagdag=0;
    }
    else if(choose==105)
    {
    buy = Integer.parseInt(JOptionPane.showInputDialog(null, "How Many Yellow Boysen Paint You Want to Buy?"));
    payment = buy*700;
    dagdag=0;
    }
    else if(choose==106)
    {
    buy = Integer.parseInt(JOptionPane.showInputDialog(null, "How Many Pink Boysen Paint You Want to Buy?"));
    payment = buy*660;
    dagdag=0;
    }
    else if(choose==107)
    {
    buy = Integer.parseInt(JOptionPane.showInputDialog(null, "How Many Rainbow Boysen Paint You Want to Buy?"));
    payment = buy*800;
    dagdag=0;
    }
    else if(choose==108)
    {
    buy = Integer.parseInt(JOptionPane.showInputDialog(null, "How Many Violet Boysen Paint You Want to Buy?"));
    payment = buy*700;
    dagdag=0;
    }
    else if(choose==109)
    {
    buy = Integer.parseInt(JOptionPane.showInputDialog(null, "How Many Maroon Boysen Paint You Want to Buy?"));
    payment = buy*620;
    dagdag=0;
    }
    else if(choose==1010)
    {
    buy = Integer.parseInt(JOptionPane.showInputDialog(null, "How Many Kulay Kalawang Boysen Paint You Want to Buy?"));
    payment = buy*780;
    dagdag=0;
    }
    else if(choose==00)
    {
    JOptionPane.showMessageDialog(null,"Total Sales: P"+b);
    System.exit(0);
    }
    else
    {
    JOptionPane.showMessageDialog(null,"Unknown Input");
    dagdag++;
    }
    }
    while(dagdag>=1);

    do{
    put = Integer.parseInt(JOptionPane.showInputDialog(null, "You Will Pay The Amount of P"+payment+"\n\n"+
    " [1]Continue\n [0]Cancel"));

    if(put==1)
    {



    bayad = Integer.parseInt(JOptionPane.showInputDialog(null, "Enter The Amount to be Paid:"));




    if(bayad<payment)


    {



    JOptionPane.showMessageDialog(null,"Insufficient Amount. Transaction Cannot be Made.");



    dagdag1++;



    }



    else if(bayad>=payment)



    {



    change = bayad-payment;



    JOptionPane.showMessageDialog(null,"Your Change is P"+change+"\nThank You For Coming!");



    dagdag1 =0;



    }

    }
    else if(put==0)
    {



    JOptionPane.showMessageDialog(null,"Thank You For Coming!");



    System.exit(0);
    }
    else
    {



    JOptionPane.showMessageDialog(null,"Unknown Input");



    dagdag1++;
    }
    b = a+payment;
    a = b;
    }
    while(dagdag1>=1);
    }
    while(true);
    }
    }
    }

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by cuddles14 View Post
    Hey there! Im done bout the functions of my program and now, I need to make my 2 Classes and a GUI for my program. I dont have any idea about making a GUI and 2 classes. please help me. below are my codes. (sorry bout some filipino words that i used.)

    This isn't a question but rather a "here's my assignment" or a homework dump. If you have no clue at all, then talk to your teacher and read the tutorials. Otherwise please ask a specific answerable question. This link can help: How to ask Smart Questions. It can give tips on how to ask questions that are answerable.

Similar Threads

  1. My Inventory Program
    By ladykrimson in forum New To Java
    Replies: 28
    Last Post: 11-01-2010, 09:06 PM
  2. Adding numbers for sales reciept program(Biginner)
    By waklo99 in forum New To Java
    Replies: 10
    Last Post: 03-18-2010, 04:09 AM
  3. Help with Inventory Program, Please
    By NewKidjava in forum New To Java
    Replies: 4
    Last Post: 08-21-2009, 11:09 AM
  4. Inventory Program
    By tlouvierre in forum New To Java
    Replies: 5
    Last Post: 05-17-2009, 05:09 AM
  5. Inventory program
    By Nexcompac in forum New To Java
    Replies: 3
    Last Post: 07-27-2007, 05:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •