Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.event.ActionEvent;
- import javax.swing.JButton;
- import javax.swing.JFrame;
- import javax.swing.JPanel;
- import javax.swing.*;
- import MieClassi.*;
- public class ProgettoDBGestionePortiCommerciali {
- public static int a=0;
- public static void main(String[] args) {
- JPanel panel = null;
- boolean status0 = false;
- boolean status1 = false;
- boolean status2 = false;
- boolean status3 = false;
- //creazione finestra
- JFrame frame =new JFrame("DB Gestione Portuale");
- frame.setVisible(true);
- frame.setSize(1024, 786);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- while(a>-1){
- switch(a){
- case 0:{
- if(status0 == false){
- if(panel!=null)
- panel.removeAll();
- panel = new JPanel();
- frame.add(panel);
- JButton Connection_button =new JButton ("Connessione");
- panel.add(Connection_button);
- Connection_button.addActionListener(new TryToConnect());
- status0 = true;
- status1 =false;
- status2 = false;
- status3 = false;
- panel.repaint();
- }
- break;
- }
- case 1:{
- if(status1 == false){
- if(panel!=null)
- panel =new JPanel();
- frame.add(panel);
- JButton Disconnect_button=new JButton("Disconnessione");
- JButton Populate_button= new JButton("Aggiungi a Database");
- JButton Quary_button= new JButton ("Cerca nel database");
- panel.add(Disconnect_button);
- panel.add(Populate_button);
- panel.add(Quary_button);
- Disconnect_button.addActionListener(new Disconnettore());
- Populate_button.addActionListener(new Population());
- Quary_button.addActionListener(new Query());
- status0 = false;
- status1 = true;
- status2 = false;
- status3 = false;
- panel.repaint();
- }
- break;
- }
- case 2:{
- if(status2==false){
- status0 = false;
- status1 = false;
- status2 = true;
- status3 = false;
- }
- break;
- }
- case 3:{
- if(status3==false){
- status0 = false;
- status1 = false;
- status2 = false;
- status3 = true;
- }
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement