Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > Java GUI
| Search | Today's Posts | Mark Forums Read
Java GUI Discussions specific to programming Java GUI.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java GUI section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 9th, 2012, 06:47 AM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need help!! Example of a simple program used for business!

can anyone give me some examples of programs using JOption which are somehow similar to cashier register or programs used for registration of students or others. They should have the function to add, subtract, delete, update, and can be stored. I need it as an example for our module in our project proposal and project defense.. hope u can help me out..

tnx.. =>
 
Old April 23rd, 2012, 03:51 AM
Authorized User
Points: 209, Level: 4
Points: 209, Level: 4 Points: 209, Level: 4 Points: 209, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2012
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by paulymonz View Post
can anyone give me some examples of programs using JOption which are somehow similar to cashier register or programs used for registration of students or others. They should have the function to add, subtract, delete, update, and can be stored. I need it as an example for our module in our project proposal and project defense.. hope u can help me out..

tnx.. =>
Hello colleague,
Please find herewith a similartype ofyour requirements using JOption class etc that requires a little bit of modifications however to enable for the studentregistering task .(replacing InvoiceDetails with StudentDetails)
Thanks if ok
As
muthukutta1
Quote:
import javax.swing.JOptionPane;
import java.util.Formatter;

public class InvoiceWithProductApp
{
public static void main(String[] args)
{
// declare and initialize variables
String choice = "", numberStr = "", productIDStr = "",
typeStr = "", orderQuantityStr = "",outputMessage = "";
int type = 0, orderQuantity = 0;

// declare invoice object
InvoiceWithProduct anInvoice = null;

while (!(choice.equalsIgnoreCase("x")))
{
// get user input
numberStr = JOptionPane.showInputDialog("Enter invoice number: ");

productIDStr = JOptionPane.showInputDialog("Enter product ID: ");

orderQuantityStr = JOptionPane.showInputDialog("Enter order quantity: ");

orderQuantity = Integer.parseInt(orderQuantityStr);

typeStr = JOptionPane.showInputDialog(
"Enter invoice type (1=regular 2=discounted): ");
type = Integer.parseInt(typeStr);

// create Invoice object
anInvoice = new InvoiceWithProduct(numberStr, productIDStr,
orderQuantity, type);

// prepare for output
outputMessage = String.format
( "Invoice number: %s\nInvoice date: %tD\nProduct ID: %s\n"
+ "Product Desc: %s\nProduct price: $%.2f\nOrder quantity: %d\n"
+ "Invoice type: %d\nInvoice discount: %.2f%%\nTax rate: %.2f%%\n"
+ "Invoice total: $%.2f\nInvoice count: %d\n\n"
+ "Press Enter to continue or 'x' to exit:",
anInvoice.getInvoiceNumber(), anInvoice.getInvoiceDate(),
anInvoice.getAProduct().getProductID(),
anInvoice.getAProduct().getProductDescription(),
anInvoice.getAProduct().getProductPrice(),
anInvoice.getOrderQuantity(), anInvoice.getInvoiceType(),
anInvoice.getDiscountPercent() * 100, anInvoice.getTAX_RATE() * 100,
anInvoice.getInvoiceTotal(), InvoiceWithProduct.getInvoiceCount());

// display output
choice = JOptionPane.showInputDialog
(null, outputMessage, "Invoice Application", JOptionPane.PLAIN_MESSAGE);
} // end while

System.exit(0);

} // end main

} // end




Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple assembly program runtime error vraifreud Visual C++ 2005 0 September 21st, 2007 01:20 AM
Simple Program Help hobbit666 Visual Basic 2005 Basics 2 December 19th, 2006 11:51 AM
Simple Java Program WargeMaster Java GUI 1 September 9th, 2005 12:25 PM
Setup Project: Program not added in Start>Program arif_1947 VS.NET 2002/2003 2 March 31st, 2005 06:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.