Create A Restaurant Ordering System Using JFrame
Oct 14, 2014How to create a restaurant ordering system using JFrame .....
View RepliesHow to create a restaurant ordering system using JFrame .....
View Repliesit gives me an error at the end class part some syntax error insert "}"..
* Course: IT110 - Introduction to Programming
* Filename: MyCustomShirtsPhase1.java
*
* Purpose: Created a simple online ordering system for My Custom Shirts customers
*/
import javax.swing.JOptionPane;
[code]....
requirments:
meal module -payment module
list of items/vm
single item - delated/add
value meal item
all with prizes
price module
per items
per meal
total
Why the JFrame is not working
// Project: RestaurantBillCalculator.java Calculates a table's bill.
// Import statements for different classes
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import java.text.*;
import java.util.*;
import javax.swing.*;
public class RestaurantBillCalculator extends JFrame
[Code] ....
So for the last few weeks I have been working on a Java project for school. I see the light at the end of the tunnel, but I have run into some speed bumps with my main class. It was working fine, but I was pulling an all night and I deleted some of my code by mistake.Now I am not seeing what is exactly wrong. Anyways, the project was to create an address book complete with a menu system.
Here are all of my classes:
import java.util.ArrayList;
/**
* A model of an address book which keeps track of contacts.
* An address book object should keep track of the concept of a current contact (think index).
* You must use an ArrayList for your implementation.
*/
public class AddressBook {
Contact contact = new Contact();
[code]....
So I'm trying to create a simple user database that I could eventually turn into a login system. I created a simple table on MySQL with a name and address for the sake of simplicity. I tried to create simple statement inside my main method that would connect to my MySQL server and when I run my program I get a ClassNotFoundException from "org.gjt.mm.mysql.Driver"..Here is what I have in my main method thus far:
public static void main(String args[]) {
try {
Class.forName("org.gjt.mm.mysql.Driver"); //Load the driver
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/data", "root", ""); //Connect
/*
conn.createStatement().execute("CREATE TABLE people (" + "id int(64) NOT NULL AUTO_INCREMENT," + "name varchar(255) NOT NULL," + "address varchar(255) NOT NULL," + "UNIQUE (id)," + "FULLTEXT(name, address))");
[code]....
I downloaded Connector/J in the the binary .zip form and extracted it to my C: drive and put the .jar file into my java directories lib folder. I also added the directory of the .jar file into my CLASSPATH and I still get the exception.
I installed Windowsbuilder in Eclipse as described in this video:URL....
To get starated I now want to create a simple JFrame application that works in the following way. On the opening screen I want to present 4 buttons. Based on the selection I want the JFrame to change layout and components so that the same JFrame behind the scenes contains 5 layouts but only one visible at any time. What is the best way to accomplish this? Or should I do this in another way using multiple JFrames or similar?
import java.io.*;
public class Booking {
private Customer[] [] booking = new Customer [7] [tables];
private int count = tables;
private String restaurant;
[Code] ......
I am trying to do this program. it compiles and everything but the numbers are not coming out right. Heres the problem.
Write a program that computes the tax and tip on a restaurant bill. The program should use JOptionPane to ask the user to enter the charge for the meal. The tax should be 6.75 percent of the meal charge. The tip should be 15 percent of the total after adding the tax. Display the meal charge, tax amount, tip amount, and total bill on the screen.
import javax.swing.JOptionPane;
public class Bill {
public static void main(String[] args) {
double mealPurchase = 0;
mealPurchase = Double.parseDouble(JOptionPane.showInputDialog(nul l, " Enter meal total: "));
[Code] .....
Okay I am making a class for a reservation project for reservations at a restaurant. So in the end the whole thing has to take reservations, with a GUI and "book" them. For this class of the project I have to add a item to a array (that being name, phone, and so on). I also have to make a sort method.
private static int indexOfMinInRange(Reservations[] a,int low,int high) {
int max=high;
for(int i=high+1;i>=low;i--)
{if()
{max=i;}}
return max;}
[Code] ....
I am working with IndexOfMinInRange method, I don't know whether to set the return type to Reservations, or to set the array in the parameter to Reservations. This is my main problem.
I am new to java and I am creating a system that will ask the user to create a file that will store to a text file, Once the user created the file I have a class that will let the user input the subject name that has been created, However, I keep on getting this java.util.nosuchelementexception.Here's my code:
public void display_by_name()
{
String id, name,total;
String key[]=new String[30];
String value[]=new String[30];
int i=0;
[code]....
i am studying java from head first java book and yesterday i was working on a program called QuizCardBuilder. what i noticed is that when i changed the order of the lines from the book i get a blank frame with nothing on it.this is my code that gives blank frame
public class QuizCardBuilder{
JFrame frame;
JTextArea question;
JTextArea answer;
JButton nextButton;
ArrayList<QuizCard> cardList;
[code]....
So my code works perfectly when I input (a+(c-d) and i get ab+cd- for postfix and *+ab-cd for prefix. However when I input a+b+c for infix i receive abc++ postfix and +a+bc prefix when its supposed to be ab+c+ postfix and ++a b c prefix. So my issue is that any infix input with parenthesis, it converts them correctly, however without parenthesis it does not convert correctly.
import java.util.*;
public class stack {
public static char[] convertToPostfix(char[] infixEx) {
Stack<Character> operatorStack = new Stack<Character>();
char[] postfix = new char[infixEx.length];
int index = 0;
[Code] .....
I've got the layout put correctly but I can't seem to get my action listeners to work correctly.
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
public class PizzaOrderDriver
{
public static void main(String[] args)
{
JCheckBox show1;
[Code] .....
This is my code for a Pizza Pickup and delivery I am am having a few issues.
public class Internal {
public static void main(String[]args) {
double total2 = 0;
String customerName = " ";
String address = " ";
String phoneNum ="0";
[Code] ....
I have a assignment to do some Lexigraphic ordering. I have figured how to get the majority of this done, however, when I input my string values. No output takes place? :s
import java.util.Scanner;
public class Lab03c {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner lexi = new Scanner (System.in);
String s1,s2;
[Code] ....
So I have this line of code...
ioexception11.addChoosableFileFilter(new Jframe());
And when I compile it gives me...
error: constructor Jframe in class Jframe cannot be applied to given types;
ioexception11.addChoosableFileFilter(new Jframe());
how we call a jFrame from another jFrame .
View Replies View RelatedIn the class below I'm trying to create a class that will accept dates in various formats and create a range. The first constructor is easy because I send it the begin date and end date as Date objects. Now I want to send a month(and year) in a constructor and derive the begin and end dates from it. In my constructor that accepts the month/year I need to put the this(startDate, endDate) at the top to be allowed, but the parameters are not built yet.
package com.scg.athrowaway;
import java.util.Calendar;
import java.util.Date;
public class DateRange {
private Date startDate;
private Date endDate;
[code].....
I'm having some difficulty with my bank account project. I'm supposed to create a menu where the user can create a new account, withdraw, deposit, view their balance, and exit. There's issues with the account creation.
Here's my necessitated class below: BankAccount, TestBankAccount, SavingsAccount, CurrentAccount, and Bank
/*---------------------------------------------------
Plagiarism Statement
I certify that this assignment is my own work and that I have not copied in part or whole or otherwise plagiarized the work of other students and/or persons.
----------------------------------------------------------*/
package BankAccount;
import java.util.Date;
import java.util.Random;
//Project 3
public class BankAccount {
protected static int accountID;
[code]....
I have the Java Development Kit downloaded in my C file and my book tells me to compile the program I need to open command windowand change the directory where the program is stored. I tried the command cd to change directory and received this message "The system cannot find the path specified."
I checked the Environment Variables on Windows 7 and the Path says: C:Program Files (x86)Javajre1.8.0_31in
This is after many tries and i still can't change directory and i keep getting the same message.
I'm making a stock system for the heck of it,so everything was going great until I hit the loop I am trying to use a for loop to add stock to the stock system,any way the question is maily about loops.How come I cannot declare a variable outside a loop and assign a value to it,for example I can declare as follows and I will not get an error,
for(int i=0;i<10;i++){
System.out.println("example");
}
but in my code(and yes its the only error I get I tested it) I get an error and can only declare and assign a value inside the loop,the reason for this is because I wanted to get the value from another class and use it in the loop ok so heres the code from both classes.
public class mainn{
public static void main(String [] args){
stock first = new stock();
int internal;
internal = first.wanted;
[code]....
I have the Java Development Kit downloaded in my C file and my book tells me to compile the program I need to open command windowand change the directory where the program is stored. I tried the command cd to change directory and received this message "The system cannot find the path specified." I checked the Environment Variables on Windows 7 and the Path says: C:Program Files (x86)Javajre1.8.0_31in
This is after many tries and i still can't change directory and i keep getting the same message.The book I am using to learn Java is "Java How to Program: Tenth Edition" from Paul and Harvey Deitel.
I'm assigned along with two others to make this program for a project.
We need to store data to the program by adding them such as user_id among the 5 criterias that are needed. Lets say I want a new user, I need the program to give me that option and then I would type in the user id and the program would store that data information
As far as I'm aware, boolean, screentokenizer and scanner is involved in the making of this program.
In my java program I'm changing my IP(using proxy) and sending the request to some sites. Later some point of time, I want to know my current IP address through java program itself. How to get hold of my current IP address? Also which IP address will it show? The proxy one or the original IP ?
View Replies View RelatedI have designed a code that is aimed at simulating a banking environment using access database. However, there are errors and i am not able to create a new account.
import java.awt.*;
import java.awt.event.*;
import java.awt.FlowLayout;
import java.sql.*;
import javax.swing.*;
public class Bank extends JFrame implements ActionListener
[Code] ......