Create a Java FX GUI program that allows the user to view and edit data from a d
ID: 3777674 • Letter: C
Question
Create a Java FX GUI program that allows the user to view and edit data from a database using a TableView component.
Instructions: The goal of this project is to write a Java FX GUI database program (use the CPU database you created in previous projects). The program should have a TableView component which on launch, shows the contents of the database. All of the cells of the table except the those of the ID column need to be editable. When edited the data needs to be rst validated (numbers, text, blank, etc.) then the database should be updated with the new cell data. Finally the program should have a delete button that allows a selected row from the database to be deleted. The TableView should be updated after the deletion.
The report needs to be in the following format: Intel Core i7-6700HQ @ 2.60GHz: $1,509.00 Intel Core i7-3770K @ 3.50GHz: $560.50 Intel Core i5-3570K @ 3.40GHz: $477.23 Intel Core i7-4700MQ @ 2.40GHz: $467.40
SQL database: create database intelprocessors; use intelprocessors; show tables; create table computers(id int not null auto_increment primary key, cpuname varchar( 32 ) not null, performance varchar( 32 ) not null, price float); describe computers;
Explanation / Answer
package javapoker;
public category Cardpersonal short rank, suit;
personal static String[] suits = ;
personal static String[] ranks = come back ranks[__rank];
}
Card(short suit, short rank)
public @Override String toString()
come back ranks[rank] + " of " + suits[suit];
}
public short getRank() come back rank;
}
public short getSuit() come back suit;
}
}
package javapoker;
import java.util.Random;import java.util.ArrayList;
public category Deck personal ArrayList<Card> cards;
Deck()
}
int size
for (int i=0; i<100; i++)
one );
index_2 = generator.nextInt( cards.size() - one );
worker = cards.get( index_2 );
cards.set( index_2 , cards.get( index_1 ) );
cards.set( index_1, temp );
}
}
public Card drawFromDeck()
come cards.remove( zero );
}
public int getTotalCards()
come back cards.size();
//we may use this methodology once creating
//a complete cards to examine if we wanted a replacement deck
}
}