Cinema Booking System
Hi I'm coding a Cinema Booking system as a project for university. Unluckily it is the easter break. My question is how would I get the seats so I can multiply the number of seats by the specific ticket value and also set that seat to be unavailable. (This needs also to be multiple seats.) Sorry about my written english.

Here's my code so far:

    // CM1203 Fundamentals of Computing with Java; Second Assignement.
    // Walter Carvalho - C1001984; 2012.
    // Cardiff University
    
    // Load Libraries
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    
    public class cinemaSystem extends JFrame implements ActionListener {
    	// Global Variables
    	
    	JFrame frame = new JFrame(); // Creates JFrame
    	JLabel title;
    	JToggleButton l[][], m[][], r[][]; // Names grid of JButtons
    	JPanel panel1, panel2, panel3;
    	ArrayList mlist;
    	
    	// Constructor
    	public cinemaSystem(){
    
    			title = new JLabel("Cinema Booking");
    			title.setFont(new Font("Helvetica", Font.BOLD, 30));
    			title.setLocation(12,5);
    			title.setSize(600, 60);
    		
    			frame.setLayout(null); // Setting Grid Layout
    			// panel1.setLayout(new GridLayout(seat,row));
    			l = new JToggleButton[4][4]; // Allocating Size of Grid
    			panel1 = new JPanel(new GridLayout(4,4));
    			panel1.setBounds(20, 70, 220, 140);
    			for(int y = 0; y <4 ; y++){
    					for(int x = 0; x < 4; x++){
    						l[x][y] = new JToggleButton("L" + y + x); // Creates New JButton
    						l[x][y].addActionListener(this);
    						panel1.add(l[x][y]); //adds button to grid
    					}
    			}
    	
    			m = new JToggleButton[4][2]; // Allocating Size of Grid
    			panel2 = new JPanel(new GridLayout(2,4));
    			panel2.setBounds(240, 140, 220, 70);
    			for(int y = 0; y <2 ; y++){
    					for(int x = 0; x < 4; x++){
    						m[x][y] = new JToggleButton("M" + y + x); // Creates New JButton
    						m[x][y].addActionListener(this);
    						panel2.add(m[x][y]); //adds button to grid
    					}
    			}
    	
    			r = new JToggleButton[4][4]; // Allocating Size of Grid
    			panel3 = new JPanel(new GridLayout(4,4));
    			panel3.setBounds(460, 70, 220, 140);
    			for(int y = 0; y <4 ; y++){
    					for(int x = 0; x < 4; x++){
    						r[x][y] = new JToggleButton("R" + y + x); // Creates New JButton
    						r[x][y].addActionListener(this);
    						panel3.add(r[x][y]); //adds button to grid
    					}
    			}
    			
    			frame.add(title);
    			frame.add(panel1);
    			frame.add(panel2);
    			frame.add(panel3);
    			frame.setPreferredSize(new Dimension(700, 250));
    			frame.setTitle("Cinema Booking");
    			frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    			frame.pack(); //sets appropriate size for frame
    			frame.setVisible(true); //makes frame visible
    	}
    	
    	public void actionPerformed(ActionEvent e)
    	{
    		for(int y = 0; y <4 ; y++){
    			for(int x = 0; x < 4; x++){
    				
    				boolean selected = l[x][y].isSelected();
    				
    				if (e.getSource() == l[x][y]) {
    					System.out.println(e.getActionCommand() + " " + selected);
    				}
    				
    			}
    		}
    		
    		for(int y = 0; y <4 ; y++){
    			for(int x = 0; x < 4; x++){
    				
    				boolean rselected = r[x][y].isSelected();
    				
    				if (e.getSource() == r[x][y]) {
    					System.out.println(rselected);
    				}
    			}
    		}
    		
    		
    		for(int y = 0; y <2 ; y++){
    			for(int x = 0; x < 4; x++){
    				
    				mlist = new ArrayList();
    				boolean mselected = m[x][y].isSelected();
    				
    				if (e.getSource() == m[x][y]) {
    				mlist.add(mselected);
    				System.out.print(mlist);
    				}
    				
    				// System.out.print(mselected + " ");
    			}
    		}
    	}
    	
    	// Main Class
    	public static void main(String[] args) {
    			new cinemaSystem(); //makes new ButtonGrid with 2 parameters
    	}
    }
Cinema Booking System
===

Hi I'm coding a Cinema Booking system as a project for university. Unluckily it is the easter break. My question is how would I get the seats so I can multiply the number of seats by the specific ticket value and also set that seat to be unavailable. (This needs also to be multiple seats.) Sorry about my written english.

Here's my code so far:

    // CM1203 Fundamentals of Computing with Java; Second Assignement.
    // Walter Carvalho - C1001984; 2012.
    // Cardiff University
    
    // Load Libraries
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    
    public class cinemaSystem extends JFrame implements ActionListener {
    	// Global Variables
    	
    	JFrame frame = new JFrame(); // Creates JFrame
    	JLabel title;
    	JToggleButton l[][], m[][], r[][]; // Names grid of JButtons
    	JPanel panel1, panel2, panel3;
    	ArrayList mlist;
    	
    	// Constructor
    	public cinemaSystem(){
    
    			title = new JLabel("Cinema Booking");
    			title.setFont(new Font("Helvetica", Font.BOLD, 30));
    			title.setLocation(12,5);
    			title.setSize(600, 60);
    		
    			frame.setLayout(null); // Setting Grid Layout
    			// panel1.setLayout(new GridLayout(seat,row));
    			l = new JToggleButton[4][4]; // Allocating Size of Grid
    			panel1 = new JPanel(new GridLayout(4,4));
    			panel1.setBounds(20, 70, 220, 140);
    			for(int y = 0; y <4 ; y++){
    					for(int x = 0; x < 4; x++){
    						l[x][y] = new JToggleButton("L" + y + x); // Creates New JButton
    						l[x][y].addActionListener(this);
    						panel1.add(l[x][y]); //adds button to grid
    					}
    			}
    	
    			m = new JToggleButton[4][2]; // Allocating Size of Grid
    			panel2 = new JPanel(new GridLayout(2,4));
    			panel2.setBounds(240, 140, 220, 70);
    			for(int y = 0; y <2 ; y++){
    					for(int x = 0; x < 4; x++){
    						m[x][y] = new JToggleButton("M" + y + x); // Creates New JButton
    						m[x][y].addActionListener(this);
    						panel2.add(m[x][y]); //adds button to grid
    					}
    			}
    	
    			r = new JToggleButton[4][4]; // Allocating Size of Grid
    			panel3 = new JPanel(new GridLayout(4,4));
    			panel3.setBounds(460, 70, 220, 140);
    			for(int y = 0; y <4 ; y++){
    					for(int x = 0; x < 4; x++){
    						r[x][y] = new JToggleButton("R" + y + x); // Creates New JButton
    						r[x][y].addActionListener(this);
    						panel3.add(r[x][y]); //adds button to grid
    					}
    			}
    			
    			frame.add(title);
    			frame.add(panel1);
    			frame.add(panel2);
    			frame.add(panel3);
    			frame.setPreferredSize(new Dimension(700, 250));
    			frame.setTitle("Cinema Booking");
    			frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    			frame.pack(); //sets appropriate size for frame
    			frame.setVisible(true); //makes frame visible
    	}
    	
    	public void actionPerformed(ActionEvent e)
    	{
    		for(int y = 0; y <4 ; y++){
    			for(int x = 0; x < 4; x++){
    				
    				boolean selected = l[x][y].isSelected();
    				
    				if (e.getSource() == l[x][y]) {
    					System.out.println(e.getActionCommand() + " " + selected);
    				}
    				
    			}
    		}
    		
    		for(int y = 0; y <4 ; y++){
    			for(int x = 0; x < 4; x++){
    				
    				boolean rselected = r[x][y].isSelected();
    				
    				if (e.getSource() == r[x][y]) {
    					System.out.println(rselected);
    				}
    			}
    		}
    		
    		
    		for(int y = 0; y <2 ; y++){
    			for(int x = 0; x < 4; x++){
    				
    				mlist = new ArrayList();
    				boolean mselected = m[x][y].isSelected();
    				
    				if (e.getSource() == m[x][y]) {
    				mlist.add(mselected);
    				System.out.print(mlist);
    				}
    				
    				// System.out.print(mselected + " ");
    			}
    		}
    	}
    	
    	// Main Class
    	public static void main(String[] args) {
    			new cinemaSystem(); //makes new ButtonGrid with 2 parameters
    	}
    }