Implementato il Login/Registrazione via GUI. Quasi completato la GUI lato utente. Manca la visualizzazione degli articoli con e senza scadenza con limiti (implementati ma senza actionlistner) e il visualizzo storico.
Da fixare anche il comparatore tra oggetti per la visualizzazione ordinata, bisogna aggiungere la classa prestazioni dopera.
This commit is contained in:
12
it/unisa/info13d/Gui/AdminInterface.java
Normal file
12
it/unisa/info13d/Gui/AdminInterface.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package it.unisa.info13d.Gui;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
* Created with MONSTER.
|
||||
* User: xgiovio
|
||||
* Date: 19/01/14
|
||||
* Time: 19.05
|
||||
*/
|
||||
public class AdminInterface extends JFrame {
|
||||
}
|
||||
160
it/unisa/info13d/Gui/LoginWindow.java
Normal file
160
it/unisa/info13d/Gui/LoginWindow.java
Normal file
@@ -0,0 +1,160 @@
|
||||
package it.unisa.info13d.Gui;
|
||||
|
||||
import it.unisa.info13d.Login.Access;
|
||||
import it.unisa.info13d.Login.LoginData;
|
||||
import it.unisa.info13d.GestioneCatalogo.*;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
|
||||
/**
|
||||
* Created with MONSTER.
|
||||
* User: xgiovio
|
||||
* Date: 19/01/14
|
||||
* Time: 16.25
|
||||
*/
|
||||
public class LoginWindow extends JFrame {
|
||||
|
||||
public LoginWindow () {
|
||||
|
||||
JPanel mainWindow = new JPanel();
|
||||
mainWindow.setLayout(new BorderLayout());
|
||||
add(mainWindow);
|
||||
|
||||
JPanel center_panel = new JPanel();
|
||||
center_panel.setLayout(new BoxLayout(center_panel, BoxLayout.PAGE_AXIS) );
|
||||
mainWindow.add(center_panel,BorderLayout.CENTER);
|
||||
|
||||
|
||||
|
||||
|
||||
JPanel user_panel = new JPanel();
|
||||
center_panel.add(user_panel);
|
||||
|
||||
JPanel pass_panel = new JPanel();
|
||||
center_panel.add(pass_panel);
|
||||
|
||||
|
||||
JLabel userl = new JLabel("User ");
|
||||
JTextField usert= new JTextField(10);
|
||||
|
||||
JLabel passl = new JLabel("Password");
|
||||
JPasswordField passt= new JPasswordField(10);
|
||||
|
||||
|
||||
user_panel.add(userl);
|
||||
user_panel.add(usert);
|
||||
pass_panel.add(passl);
|
||||
pass_panel.add(passt);
|
||||
|
||||
|
||||
|
||||
JPanel buttons_panel = new JPanel();
|
||||
|
||||
|
||||
JButton submit_login = new JButton("Login");
|
||||
JButton submit_register = new JButton("Go to Register Form");
|
||||
|
||||
center_panel.add(buttons_panel);
|
||||
|
||||
buttons_panel.add(submit_login);
|
||||
buttons_panel.add(submit_register);
|
||||
|
||||
|
||||
class login_action implements ActionListener {
|
||||
|
||||
|
||||
public login_action (LoginWindow in_actual,JTextField in_name, JPasswordField in_password, JTextField in_location, boolean in_action){
|
||||
name = in_name;
|
||||
password = in_password;
|
||||
location = in_location;
|
||||
action = in_action;
|
||||
actual = in_actual;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try{
|
||||
if (Access.search_username(name.getText(),String.valueOf(password.getPassword()))){
|
||||
LoginData login = new LoginData(name.getText(),String.valueOf(password.getPassword()),location.getText(),action);
|
||||
Catalogo load_catalogo = new Catalogo();
|
||||
if (login.getType().equals("Admin")){
|
||||
actual.setVisible(false);
|
||||
//AdminInterface a = new AdminInterface(actual,load_catalogo,login);
|
||||
}else{
|
||||
actual.setVisible(false);
|
||||
UserInterface c = new UserInterface(actual,load_catalogo,login);
|
||||
}
|
||||
|
||||
|
||||
} else{
|
||||
|
||||
JOptionPane.showMessageDialog(actual,
|
||||
"User e/o Pass Inesistenti ",
|
||||
"Login Error",
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
|
||||
}
|
||||
catch (FileNotFoundException err){}
|
||||
catch (IOException err){}
|
||||
catch (ClassNotFoundException err){}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private JTextField name;
|
||||
private JPasswordField password;
|
||||
private JTextField location;
|
||||
private boolean action;
|
||||
private LoginWindow actual;
|
||||
|
||||
|
||||
}
|
||||
class register_action implements ActionListener {
|
||||
|
||||
|
||||
public register_action (LoginWindow in_w){
|
||||
w = in_w;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
w.setVisible(false);
|
||||
RegisterWindow r = new RegisterWindow(w,w.getLocation());
|
||||
}
|
||||
|
||||
LoginWindow w;
|
||||
|
||||
|
||||
}
|
||||
submit_login.addActionListener(new login_action(this,usert,passt,usert,false));
|
||||
submit_register.addActionListener(new register_action(this));
|
||||
|
||||
|
||||
|
||||
setSize(250, 130);
|
||||
setLocation(150, 150);
|
||||
setTitle("Exam APP");
|
||||
setVisible(true);
|
||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
166
it/unisa/info13d/Gui/RegisterWindow.java
Normal file
166
it/unisa/info13d/Gui/RegisterWindow.java
Normal file
@@ -0,0 +1,166 @@
|
||||
package it.unisa.info13d.Gui;
|
||||
|
||||
import it.unisa.info13d.Login.Access;
|
||||
import it.unisa.info13d.Login.LoginData;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
|
||||
/**
|
||||
* Created with MONSTER.
|
||||
* User: xgiovio
|
||||
* Date: 19/01/14
|
||||
* Time: 16.25
|
||||
*/
|
||||
public class RegisterWindow extends JFrame {
|
||||
|
||||
public RegisterWindow( LoginWindow in_back, Point in_point ) {
|
||||
|
||||
setLocation(in_point);
|
||||
back = in_back;
|
||||
|
||||
JPanel mainWindow = new JPanel();
|
||||
mainWindow.setLayout(new BorderLayout());
|
||||
add(mainWindow);
|
||||
|
||||
JPanel center_panel = new JPanel();
|
||||
center_panel.setLayout(new BoxLayout(center_panel, BoxLayout.PAGE_AXIS) );
|
||||
mainWindow.add(center_panel,BorderLayout.CENTER);
|
||||
|
||||
|
||||
|
||||
|
||||
JPanel user_panel = new JPanel();
|
||||
center_panel.add(user_panel);
|
||||
|
||||
JPanel pass_panel = new JPanel();
|
||||
center_panel.add(pass_panel);
|
||||
|
||||
JPanel location_panel = new JPanel();
|
||||
center_panel.add(location_panel);
|
||||
|
||||
|
||||
|
||||
JLabel userl = new JLabel("User ");
|
||||
JTextField usert= new JTextField(10);
|
||||
|
||||
JLabel passl = new JLabel("Password");
|
||||
JPasswordField passt= new JPasswordField(10);
|
||||
|
||||
JLabel locationl = new JLabel("Location ");
|
||||
JTextField locationt= new JTextField(10);
|
||||
|
||||
|
||||
user_panel.add(userl);
|
||||
user_panel.add(usert);
|
||||
pass_panel.add(passl);
|
||||
pass_panel.add(passt);
|
||||
location_panel.add(locationl);
|
||||
location_panel.add(locationt);
|
||||
|
||||
|
||||
|
||||
JPanel buttons_panel = new JPanel();
|
||||
|
||||
|
||||
JButton submit_register = new JButton("Register");
|
||||
JButton submit_back = new JButton("Back");
|
||||
|
||||
center_panel.add(buttons_panel);
|
||||
|
||||
buttons_panel.add(submit_register);
|
||||
buttons_panel.add(submit_back);
|
||||
|
||||
|
||||
class register_action implements ActionListener {
|
||||
|
||||
|
||||
public register_action (RegisterWindow in_actual,JTextField in_name, JPasswordField in_password, JTextField in_location, boolean in_action){
|
||||
name = in_name;
|
||||
password = in_password;
|
||||
location = in_location;
|
||||
action = in_action;
|
||||
actual = in_actual;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try{
|
||||
if ( location.getText().isEmpty() || name.getText().isEmpty() || String.valueOf(password.getPassword()).isEmpty() ){
|
||||
JOptionPane.showMessageDialog(actual,
|
||||
"Completare tutti i campi ",
|
||||
"Register Error",
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
} else{
|
||||
|
||||
LoginData login = new LoginData(name.getText(),String.valueOf(password.getPassword()),location.getText(),action);
|
||||
JOptionPane.showMessageDialog(actual,
|
||||
"Registrazione Completata",
|
||||
"registration",
|
||||
JOptionPane.INFORMATION_MESSAGE);
|
||||
}
|
||||
|
||||
}
|
||||
catch (FileNotFoundException err){}
|
||||
catch (IOException err){}
|
||||
catch (ClassNotFoundException err){}
|
||||
|
||||
}
|
||||
|
||||
private JTextField name;
|
||||
private JPasswordField password;
|
||||
private JTextField location;
|
||||
private boolean action;
|
||||
private RegisterWindow actual;
|
||||
|
||||
|
||||
}
|
||||
class back_action implements ActionListener {
|
||||
|
||||
|
||||
public back_action (LoginWindow in_back, RegisterWindow in_actual){
|
||||
back = in_back;
|
||||
actual = in_actual;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
actual.setVisible(false);
|
||||
back.setVisible(true);
|
||||
|
||||
}
|
||||
|
||||
LoginWindow back;
|
||||
RegisterWindow actual;
|
||||
|
||||
|
||||
}
|
||||
submit_register.addActionListener(new register_action(this,usert,passt,locationt,true));
|
||||
submit_back.addActionListener(new back_action(back,this));
|
||||
|
||||
|
||||
|
||||
setSize(220, 180);
|
||||
setTitle("Exam APP");
|
||||
setVisible(true);
|
||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
LoginWindow back;
|
||||
|
||||
}
|
||||
389
it/unisa/info13d/Gui/UserInterface.java
Normal file
389
it/unisa/info13d/Gui/UserInterface.java
Normal file
@@ -0,0 +1,389 @@
|
||||
package it.unisa.info13d.Gui;
|
||||
|
||||
import com.sun.deploy.panel.JavaPanel;
|
||||
import it.unisa.info13d.Articoli.Utilizzabile;
|
||||
import it.unisa.info13d.GestioneCatalogo.Catalogo;
|
||||
import it.unisa.info13d.Login.Access;
|
||||
import it.unisa.info13d.Login.LoginData;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
/**
|
||||
* Created with MONSTER.
|
||||
* User: xgiovio
|
||||
* Date: 19/01/14
|
||||
* Time: 19.19
|
||||
*/
|
||||
public class UserInterface extends JFrame{
|
||||
|
||||
|
||||
public UserInterface( LoginWindow in_login_window ,Catalogo in_load_catalogo, LoginData in_login_data) throws FileNotFoundException,IOException,ClassNotFoundException{
|
||||
|
||||
login_window = in_login_window;
|
||||
load_catalogo= in_load_catalogo;
|
||||
login_data = in_login_data;
|
||||
|
||||
//////////////////////////////////////////////////// begin main menu and balance
|
||||
|
||||
JPanel mainWindow = new JPanel();
|
||||
mainWindow.setLayout(new BorderLayout());
|
||||
add(mainWindow);
|
||||
|
||||
|
||||
JPanel north = new JPanel();
|
||||
north.setLayout(new BorderLayout() );
|
||||
|
||||
|
||||
JMenuBar mainmenu = new JMenuBar();
|
||||
north.add(mainmenu,BorderLayout.NORTH);
|
||||
|
||||
JMenu filemenu = new JMenu("File");
|
||||
JMenuItem logout_menu_item = new JMenuItem("Logout");
|
||||
class logout_action implements ActionListener {
|
||||
|
||||
|
||||
public logout_action (UserInterface in_location){
|
||||
location= in_location;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
|
||||
location.setVisible(false);
|
||||
login_window.setVisible(true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private UserInterface location;
|
||||
}
|
||||
logout_menu_item.addActionListener(new logout_action(this));
|
||||
JMenuItem quit_menu_item = new JMenuItem("Quit");
|
||||
class exit_action implements ActionListener {
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
System.exit(0);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
quit_menu_item.addActionListener(new exit_action());
|
||||
|
||||
JMenu searchmenu = new JMenu("Cerca");
|
||||
JMenuItem tutti_gli_articoli_attivi = new JMenuItem("Tutti gli articoli Attivi");
|
||||
class tutti_gli_articoli_attivi_action implements ActionListener {
|
||||
|
||||
|
||||
public tutti_gli_articoli_attivi_action (UserInterface in_location, JTextArea in_offers){
|
||||
location= in_location;
|
||||
offers = in_offers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try{
|
||||
offers.setText("");
|
||||
load_catalogo.offerteAttive(login_data.getUsername(),offers);
|
||||
|
||||
}
|
||||
catch (FileNotFoundException err){}
|
||||
catch (IOException err){}
|
||||
catch (ClassNotFoundException err){}
|
||||
|
||||
}
|
||||
|
||||
private UserInterface location;
|
||||
private JTextArea offers;
|
||||
}
|
||||
//action listner for tutti_gli_articoli_attivi added at offers declaration
|
||||
|
||||
JMenuItem articoli_con_scadenza_menu_item = new JMenuItem("Articoli con Scadenza");
|
||||
JMenuItem articoli_senza_scadenza_menu_item = new JMenuItem("Articoli senza Scadenza");
|
||||
JMenu visualizzamenu = new JMenu("Visualizza");
|
||||
JMenuItem storico_menu_item = new JMenuItem("Storico Utente");
|
||||
|
||||
mainmenu.add(filemenu);
|
||||
mainmenu.add(searchmenu);
|
||||
mainmenu.add(visualizzamenu);
|
||||
|
||||
filemenu.add(logout_menu_item);
|
||||
filemenu.add(quit_menu_item);
|
||||
|
||||
searchmenu.add(tutti_gli_articoli_attivi);
|
||||
searchmenu.add(articoli_con_scadenza_menu_item);
|
||||
searchmenu.add(articoli_senza_scadenza_menu_item);
|
||||
|
||||
|
||||
visualizzamenu.add(storico_menu_item);
|
||||
|
||||
|
||||
|
||||
|
||||
JPanel BilancioPanel = new JPanel();
|
||||
JLabel bilancio = new JLabel("Bilancio" + " " + login_data.getUsername() + " = " + (Access.get_user_data(login_data.getUsername())).getBalance() );
|
||||
bilancio.setPreferredSize(new Dimension(150,60));
|
||||
JButton acquista_credito = new JButton("Acquista Credito");
|
||||
BilancioPanel.add(bilancio);
|
||||
BilancioPanel.add(acquista_credito);
|
||||
|
||||
class acquista_action implements ActionListener {
|
||||
|
||||
|
||||
public acquista_action (UserInterface in_location, JLabel in_l){
|
||||
l = in_l;
|
||||
location= in_location;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try{
|
||||
|
||||
String importo_da_ricaricare= JOptionPane.showInputDialog(location,"Inserire l'importo da ricaricare ");
|
||||
if (Double.parseDouble(importo_da_ricaricare) > 0){
|
||||
|
||||
load_catalogo.aggiungiCredito(login_data.getUsername(), importo_da_ricaricare );
|
||||
l.setText("Bilancio" + " " + login_data.getUsername() + " = " + (Access.get_user_data(login_data.getUsername())).getBalance());
|
||||
|
||||
}
|
||||
}
|
||||
catch (FileNotFoundException err){}
|
||||
catch (IOException err){}
|
||||
catch (ClassNotFoundException err){}
|
||||
catch (NumberFormatException err){
|
||||
JOptionPane.showMessageDialog(location,
|
||||
"Input Non valido ",
|
||||
"Error",
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
catch (NullPointerException err){
|
||||
JOptionPane.showMessageDialog(location,
|
||||
"Input Non valido ",
|
||||
"Error",
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private JLabel l;
|
||||
private UserInterface location;
|
||||
}
|
||||
acquista_credito.addActionListener(new acquista_action(this,bilancio));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
north.add(BilancioPanel,BorderLayout.CENTER);
|
||||
|
||||
mainWindow.add(north,BorderLayout.NORTH);
|
||||
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////// begin center area for all offers
|
||||
|
||||
|
||||
JTextArea offers = new JTextArea(500,200);
|
||||
offers.setText("Utilizza il menu Cerca per popolare questa lista");
|
||||
mainWindow.add(offers,BorderLayout.CENTER);
|
||||
tutti_gli_articoli_attivi.addActionListener(new tutti_gli_articoli_attivi_action(this,offers));
|
||||
|
||||
|
||||
|
||||
JPanel acquista_panel = new JPanel();
|
||||
|
||||
JLabel idlabel = new JLabel("ID");
|
||||
JTextField id = new JTextField(5);
|
||||
JButton aggiungi_a_carrello = new JButton("Aggiungi al Carrello");
|
||||
JLabel prodotti_nel_carello = new JLabel(" Corrello: " + Carrello.size() + " Prodotti");
|
||||
JButton acquista = new JButton("Completa Acquisto");
|
||||
|
||||
class aggiungi_al_carrello_action implements ActionListener {
|
||||
|
||||
|
||||
public aggiungi_al_carrello_action (UserInterface in_location, JTextField in_id, JTextArea in_offers, JLabel in_count){
|
||||
id = in_id;
|
||||
location= in_location;
|
||||
offers = in_offers;
|
||||
count = in_count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try{
|
||||
|
||||
if (offers.getText().isEmpty()){
|
||||
JOptionPane.showMessageDialog(location,
|
||||
"Dovresti prima aggiornare l'elenco delle offerte attive ",
|
||||
"Error",
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
} else{
|
||||
|
||||
if (Integer.parseInt(id.getText()) >= 0 ){
|
||||
int found = load_catalogo.search_product_id(login_data.getUsername(),id.getText());
|
||||
if (found > -1){
|
||||
Carrello.add(load_catalogo.getCatalogo().get(found));
|
||||
count.setText(" Corrello: " + Carrello.size() + " Prodotti");
|
||||
|
||||
}else{
|
||||
JOptionPane.showMessageDialog(location,
|
||||
"Impossibile aggiungere il prodotto indicato ",
|
||||
"Error",
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
|
||||
|
||||
}else {
|
||||
JOptionPane.showMessageDialog(location,
|
||||
"Input Non valido ",
|
||||
"Error",
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch (FileNotFoundException err){}
|
||||
catch (IOException err){}
|
||||
catch (ClassNotFoundException err){}
|
||||
catch (NumberFormatException err){
|
||||
JOptionPane.showMessageDialog(location,
|
||||
"Input Non valido ",
|
||||
"Error",
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
catch (NullPointerException err){
|
||||
JOptionPane.showMessageDialog(location,
|
||||
"Input Non valido ",
|
||||
"Error",
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private JTextField id;
|
||||
private UserInterface location;
|
||||
private JTextArea offers;
|
||||
private JLabel count;
|
||||
}
|
||||
aggiungi_a_carrello.addActionListener(new aggiungi_al_carrello_action(this,id,offers,prodotti_nel_carello));
|
||||
|
||||
class completa_acquisto implements ActionListener {
|
||||
|
||||
|
||||
public completa_acquisto (UserInterface in_location, JLabel in_count, JLabel in_bilancio){
|
||||
count = in_count;
|
||||
location= in_location;
|
||||
bilancio = in_bilancio;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try{
|
||||
|
||||
if (Carrello.size() == 0){
|
||||
JOptionPane.showMessageDialog(location,
|
||||
"Carrello Vuoto ",
|
||||
"Error",
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
} else{
|
||||
|
||||
boolean status;
|
||||
status = load_catalogo.acquistaProdotti(login_data.getUsername(),Carrello);
|
||||
|
||||
if (status){
|
||||
|
||||
|
||||
count.setText(" Corrello: 0 Prodotti");
|
||||
bilancio.setText("Bilancio" + " " + login_data.getUsername() + " = " + (Access.get_user_data(login_data.getUsername())).getBalance() );
|
||||
|
||||
JOptionPane.showMessageDialog(location,
|
||||
"Acquisto Completato",
|
||||
"Completato",
|
||||
JOptionPane.INFORMATION_MESSAGE);
|
||||
|
||||
}else{
|
||||
JOptionPane.showMessageDialog(location,
|
||||
"Impossibile completare Acquisto ",
|
||||
"Error",
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch (FileNotFoundException err){}
|
||||
catch (IOException err){}
|
||||
catch (ClassNotFoundException err){}
|
||||
catch (NumberFormatException err){
|
||||
JOptionPane.showMessageDialog(location,
|
||||
"Input Non valido ",
|
||||
"Error",
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
catch (NullPointerException err){
|
||||
JOptionPane.showMessageDialog(location,
|
||||
"Input Non valido ",
|
||||
"Error",
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private JLabel count;
|
||||
private UserInterface location;
|
||||
private JLabel bilancio;
|
||||
}
|
||||
acquista.addActionListener(new completa_acquisto(this,prodotti_nel_carello,bilancio));
|
||||
|
||||
acquista_panel.add(idlabel);
|
||||
acquista_panel.add(id);
|
||||
acquista_panel.add(aggiungi_a_carrello);
|
||||
acquista_panel.add(prodotti_nel_carello);
|
||||
acquista_panel.add(acquista);
|
||||
|
||||
|
||||
mainWindow.add(acquista_panel,BorderLayout.SOUTH);
|
||||
|
||||
|
||||
|
||||
|
||||
setSize(600, 400);
|
||||
setLocation(login_window.getLocation());
|
||||
setTitle("User " + Access.get_user_data(login_data.getUsername()).getUser() + " Logged");
|
||||
setVisible(true);
|
||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
ArrayList<Utilizzabile> Carrello = new ArrayList<Utilizzabile>();
|
||||
LoginWindow login_window;
|
||||
Catalogo load_catalogo;
|
||||
LoginData login_data;
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user