Create A Menu Where The User Can Create A New Account?
Oct 5, 2014
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]....
View Replies
ADVERTISEMENT
Nov 10, 2014
How to write a driver program, this my code I have :
import java.util.Date;
public class myAccount {
public static void main(String[] args) {
//create an instance object of class Stock
Account myAccount = new Account(012233445566, 20000.00, 0.045);
[Code] ......
View Replies
View Related
May 12, 2014
I'm trying to create a GUI java application.
I want a menu with buttons that looks like this:
Button 1: Start
Button 2: Help
Button 3: About Me
If you press one of the buttons you will get to another frame with new buttons, new labels and so on.
Next step for instance if you press button 1, I'd like my program to get this frame:
Different alternatives, and a text field with a button. One commando leads to one new JFrame with new buttons, text fields and so on.
View Replies
View Related
Dec 5, 2014
I want to create a Jtable when i click on "new" on the menu bar,but if i click on it, i still not see the table.Here is the code:
package mestint
import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.*;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JTable;
import javax.swing.border.BevelBorder;
import javax.swing.table.DefaultTableModel;
import javax.swing.*;
[code].....
View Replies
View Related
Oct 8, 2014
I would like to create a sub menu for every list item in a Jlist. I need the UI like avast interface. If we hover over an list item, its sub menu should be shown. I attempted to put an sub menu but didn't work. Is this possible in Swing?
View Replies
View Related
Oct 19, 2014
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]....
View Replies
View Related
Aug 26, 2014
I am working with Netbeans 8.0 and JSF2.2. I am trying to create a web site that has a common header, footer, and menu. The only part that would be dynamic is the content. So here goes...
1) I need a common template that has 4 parts, Header, Footer, Menu, Content
2) The header, footer and menu are to be in a separate files of which are called from the main template
3) The content will change based on the menu item changed
4) The menu has to change the content section only
I know how to do this in HTML but I am trying to set up some thing in JSF to learn more on JSF pages. All I am looking for is an example that I can follow along with having the multiple pages as well having the menu change the content (I have done a ton of internet searching but nothing really fits the bill).
This is the code I have currently.
Index (Main Template)
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html">
[Code] .....
View Replies
View Related
Feb 1, 2014
In 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].....
View Replies
View Related
Oct 18, 2014
I basically need to allow the user to add or remove toppings on the pizza once it is created. I am new to code (steps included). We are supposed to use enums and sets.
package pizza;
public class Pizza {
// Declare enums
public enum Size{
SMALL,
MEDIUM,
LARGE,
JUMBO
[code]....
I started this this is what I have currently I have an error here:
private Set<Topping> setOfToppings = new EnumSet<Topping>(Topping.class);
I am sure it is because I haven't set it up correctly.
View Replies
View Related
Sep 16, 2014
Okay, so I know how to get user input and create a variable from the input, create a basic addition sum etc...
So I have this code:
package calc;
import java.util.Scanner;
class calc{
private static final double add = 0;
private static final double subtract = 0;
public static void main(String args[]){
[Code] .....
I'm basically trying to make it so that when the user enters tnum, tnum2, tnum3 and tnum4, their answer turns to the variable which has to be either true or false to make the boolean work. I don't know really how to do this. I want to make it so that if they enter yes, then that makes the boolean true and the numbers will multiply and create the answer variable. If they enter no then the boolean is false and it moves onto the next if statement. How can I do this?
View Replies
View Related
Mar 3, 2014
i need to create a program that asks the user for an array and then asks the user to fill in the slots of the array but i have to do it in a method
View Replies
View Related
Oct 13, 2014
so I had to create a program that allows the user to enter a day using a number and then enter a year and after they did that it would create an entire calendar for that year ..so I have that but the only issue is I can not get the numbers to line up neatly.how to do the entire thing in loops, I tried a couple in here..what this would look like as loops instead of switches and cases and if else
import java.util.Scanner;
public class Calendar {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
[code]....
View Replies
View Related
Sep 17, 2014
I am new to Java an have to Create a program that keeps track of the following information input by the user: First Name, Last Name, Phone Number, and Age. Now - let's store this in a multidimensional array that will hold 10 of these contacts. So our multidimensional array will need to be 10 rows and 4 columns.You should be able to add and remove contacts in the array.
View Replies
View Related
Sep 16, 2014
I am required to read user input to create two matrices which will eventually be added together. I am unsure as to how I can read the input from the user as an int and not a String. The input is from size 0-10 for both column and row size. Also, can you have a new button created in the actionPerformed method of a previous button?
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
public class Matrices implements ActionListener {
private JFrame win1, win2, win3, win4;
[Code]...
View Replies
View Related
Jun 25, 2014
I have a database containing products which are separated in categories and subcategories.I want to create a user interface that will allow the customer to select any category or subcategory and load the products in the main application window.My problem is that i dont like tree do you know any alternative of tree that i can use ?
View Replies
View Related
Feb 17, 2015
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class App {
public static void main(String[] args) throws IOException {
Scanner keyboard = new Scanner(System.in);
System.out.println("Please Select an option > ");
[Code] .....
View Replies
View Related
Mar 3, 2015
I am trying to create a basic graphical user interface for sequence translation (including a JTextField for the description of a sequence and status of function button pressed e.g. “simple” translation and input and output TextFields). This involves a number of different class files. I cannot get my user interface to do what I want and I think I have problems with my "actionPerformed" method. How the code should be linked together?
public void actionPerformed(ActionEvent event) {
try {
// Get the description, content and result
String d = tool.getDescription();
String input = tool.getInputText();
Stringr = translation.getResult();
[code]....
View Replies
View Related
Apr 14, 2014
I am new a creating GUIs and am not quite sure how to correctly make one. I have done the inheritance parts, and created two extra appliances: a washer and dryer. Now Creating the GUI ....
Here are the instructions to my project.
Introduction to GUIs (+ some inheritance)
For this assignment, you are going to create a user interface that interacts with the setters and getters of some classes that you will create.
First, create an abstract class called Appliance. This abstract class should have two attributes (dealing with household appliances) and two abstract methods called turnOn() and turnOff(). These methods should return void.
Then, create two subclasses of Appliance that represent household appliances (like a Refrigerator or Stove ((don't use those!))). These subclasses should have two attributes that are specific to the various appliance. Each subclass should implement the turnOn() and turnOff() methods. These methods should print to the command line some information about the appliance as it turns on and off.
Now, the fun part! Create a GUI interface!
Your window should have two panels: one for each appliance subclass. Each panel should have 4 textboxes (with appropriate labels) to receive/display information that correspond to the 4 attributes (2 from Appliance and 2 from the subclass) for each subclass.You also need 2 buttons on each panel: A Get button and a Set button.
When the Get button is pressed, the text boxes should be filled with the information from the instantiated object of the appropriate subclass. When the Set button is pressed, the object should then contain the information contained that the user has altered.
In your main method, you should create an object of each subclass, and prefill it with information (either using the constructor or the setters), then display your GUI. You should now be able to get and set the information for your objects from the GUI.
At least one of your attributes for each subclass should be numeric
Note that you will need to handle incorrectly formatted input (You can use exception handling to do this if you want to. Wrapper classes also will work)
If there is text in the boxes when the "Get" button is pressed, it should be overwritten by what is in the object. Remember that these two panels should both be on screen at the same time.
You don't need 2 different windows, one window: 2 panels.
View Replies
View Related
Jun 6, 2014
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.
View Replies
View Related
Oct 28, 2014
So the assignment is as follows. Develop a new class called BankAccount. A bank account has the owner's name and balance. Be sure to include a constructor that allows the client to supply the owner's name and initial balance. A bank account needs - accessors for the name and balance, mutators for making deposits and withdrawals. I have the following code :
import java.util.Scanner;
public class BankAccount{
public static void main(String [] args){
Scanner reader = new Scanner(System.in);
double name;
double balance;
double deposit;
double withdrawl;
[Code] ....
I am having trouble with my if statements. I don't know how to link the number 1 & 2 keys to deposit and withdrawal actions. Plus I am supposed to have a while loop yet don't know how to implement this so that the while loop will ask the user if they would like to make another transaction after either depositing or withdrawing.
View Replies
View Related
Sep 25, 2014
In my account driver I am trying to get the user inputted account number to get the account by account number. In my code
System.out.println("Which Account number: "); int account = scan.nextInt();
ac.get(account-1);
This works if my accounts are numbered incrementally starting with one, I want it to match the inputted account number
System.out.println("Account number: "); int num = scan.nextInt();
I am thinking a for loop is probably needed. Here is my code:
public class AccountDriver {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
ArrayList<Account> ac = new ArrayList<>();
boolean more=true;
boolean again=false;
[code]....
View Replies
View Related
Mar 15, 2014
1. creates a file.
2. ask user to write into that file
3. save the file
4. print content of file.
Is my current exercise, so far i have gotten the code to create a file. What should i use to ask user to write into that file and save?
package assignment7;
import java.io.*;
public class Exercise2
{
public static void main ( String [ ] args ) {
String filePath="newfile.txt";
File newFile = new File ( filePath ) ;
[Code] .....
View Replies
View Related
Mar 17, 2014
1. creates a file.
2. ask user to write into that file
3. save the file
4. print content of file.
is my current exercise.so far i have gotten the code to create a file, and ask the user to input their age.what should i use to save what the user writes into the file?
Java Code:
package assignment7;
import java.io.*;
import java.util.*;
public class Exercise2
{
public static void main ( String [ ] args ) throws IOException
{
Scanner scan = new Scanner(System.in);
[code]....
View Replies
View Related
Mar 9, 2015
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]....
View Replies
View Related
Apr 8, 2014
How to fix the error with the line:
Account account1 = new account(1122, 20000.00);
import java.util.Date;
public class AccountClass {
class Account {
private int id;
private double balance;
private double annualInterestRate;
[Code] ....
I forgot to mention, the error says "account cannot be resolved to a type"
View Replies
View Related
Sep 24, 2014
i am beginner in java and i am making an application in which i want to display menu for 3 different types of users. like when we login i want to check which type of user is this and which menu to show them. for ex. if there is a employee the menu bar has a dropdown which shows activities like fill nomination, see details etc. if it privileged user he is shown a diff menu and if its the admin the dropdown shows some different activities. i want to make it through simple jsp and servlet. i have a table in data base which has types of user predefined with an id how to display that menu according to a specific user.
View Replies
View Related