Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Other Java > Java GUI
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 9th, 2012, 05: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.. =>
Reply With Quote
  #2 (permalink)  
Old April 23rd, 2012, 03:51 AM
Authorized User
Points: 59, Level: 1
Points: 59, Level: 1 Points: 59, Level: 1 Points: 59, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2012
Posts: 15
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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
P2P chat program C code (very simple) asdfdgfdhgfh User Groups - LUG 2 August 8th, 2012 06:41 AM
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 10: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 05:40 AM



All times are GMT -4. The time now is 06:00 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.