Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can someone help me understand why this code isn't working. The code is a flight seating plan. Chart: /* * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this
Can someone help me understand why this code isn't working.
The code is a flight seating plan.
Chart:
/* * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template */ package air.canada; import java.io.File; import javax.swing.JOptionPane; import java.awt.Color; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; // import java.util.Locale; /** * * @author sprince */ public class Chart extends javax.swing.JFrame { //Added Generic Arraylist of Type Seat ArrayList allSeats; File nameSave; /** * Creates new form Chart */ public Chart() { initComponents(); } //Added Function to write passengers list in file public void writeNamesInFile(ArrayList allSeats) { nameSave = new File("nameList.txt"); try { FileWriter fw = new FileWriter(nameSave, true); String strOutput = ""; for (int i = 0; i < allSeats.size(); i++) { strOutput = strOutput + allSeats.get(i).getFirstName() + "t" + allSeats.get(i).getLastName() + "t" + allSeats.get(i).getSeat() + " "; } fw.write(strOutput); fw.close(); } catch (IOException e) { e.printStackTrace(); } } //add details in arraylist public void addSeat(String firstName, String lastName, String seatNameNumber) { //Create seat object Seat seat = new Seat(); //set firstname lastname and seat seat.setFirstName(firstName); seat.setLastName(lastName); seat.setSeat(seatNameNumber.toUpperCase(Locale.ROOT)); //add seat to arraylist allSeats.add(seat); } //Get all Seats that will return arraylist public ArrayList getAllSeats() { return allSeats; } public void setAisle(javax.swing.JLabel aisleLabel, String aisleNo) { aisleLabel.setFont(new java.awt.Font("Arial", 0, 18)); aisleLabel.setForeground(new java.awt.Color(255, 0, 0)); aisleLabel.setText(aisleNo); } public void setButtons(javax.swing.JButton jButton, String btnText) { jButton.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N jButton.setText(btnText); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // private void initComponents() { jCheckBoxMenuItem1 = new javax.swing.JCheckBoxMenuItem(); jMenuBar2 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); jMenu2 = new javax.swing.JMenu(); jMenu3 = new javax.swing.JMenu(); jCheckBoxMenuItem2 = new javax.swing.JCheckBoxMenuItem(); jMenuBar3 = new javax.swing.JMenuBar(); jMenu4 = new javax.swing.JMenu(); jMenu5 = new javax.swing.JMenu(); jMenu6 = new javax.swing.JMenu(); jMenuBar4 = new javax.swing.JMenuBar(); jMenu7 = new javax.swing.JMenu(); jMenu8 = new javax.swing.JMenu(); jMenuBar5 = new javax.swing.JMenuBar(); jMenu9 = new javax.swing.JMenu(); jMenu10 = new javax.swing.JMenu(); jMenuBar6 = new javax.swing.JMenuBar(); jMenu11 = new javax.swing.JMenu(); jMenu12 = new javax.swing.JMenu(); chartLbl = new javax.swing.JLabel(); aisle1 = new javax.swing.JLabel(); aisle2 = new javax.swing.JLabel(); aisle3 = new javax.swing.JLabel(); aisle4 = new javax.swing.JLabel(); aisle6 = new javax.swing.JLabel(); aisle5 = new javax.swing.JLabel(); aisle7 = new javax.swing.JLabel(); aisle8 = new javax.swing.JLabel(); aisle9 = new javax.swing.JLabel(); aisle10 = new javax.swing.JLabel(); manifest = new javax.swing.JButton(); waitlist = new javax.swing.JButton(); exitBtn = new javax.swing.JButton(); a1 = new javax.swing.JButton(); b1 = new javax.swing.JButton(); a2 = new javax.swing.JButton(); a3 = new javax.swing.JButton(); a4 = new javax.swing.JButton(); a5 = new javax.swing.JButton(); a6 = new javax.swing.JButton(); a7 = new javax.swing.JButton(); a8 = new javax.swing.JButton(); a9 = new javax.swing.JButton(); a10 = new javax.swing.JButton(); b2 = new javax.swing.JButton(); b3 = new javax.swing.JButton(); b4 = new javax.swing.JButton(); b5 = new javax.swing.JButton(); b6 = new javax.swing.JButton(); b7 = new javax.swing.JButton(); b8 = new javax.swing.JButton(); b9 = new javax.swing.JButton(); b10 = new javax.swing.JButton(); c1 = new javax.swing.JButton(); c2 = new javax.swing.JButton(); c3 = new javax.swing.JButton(); c4 = new javax.swing.JButton(); c5 = new javax.swing.JButton(); c6 = new javax.swing.JButton(); c7 = new javax.swing.JButton(); c8 = new javax.swing.JButton(); c9 = new javax.swing.JButton(); c10 = new javax.swing.JButton(); d1 = new javax.swing.JButton(); e1 = new javax.swing.JButton(); f1 = new javax.swing.JButton(); d2 = new javax.swing.JButton(); d3 = new javax.swing.JButton(); d4 = new javax.swing.JButton(); d5 = new javax.swing.JButton(); d6 = new javax.swing.JButton(); d7 = new javax.swing.JButton(); d8 = new javax.swing.JButton(); d9 = new javax.swing.JButton(); d10 = new javax.swing.JButton(); e2 = new javax.swing.JButton(); e3 = new javax.swing.JButton(); e4 = new javax.swing.JButton(); e5 = new javax.swing.JButton(); e6 = new javax.swing.JButton(); e7 = new javax.swing.JButton(); e8 = new javax.swing.JButton(); e9 = new javax.swing.JButton(); e10 = new javax.swing.JButton(); f2 = new javax.swing.JButton(); f3 = new javax.swing.JButton(); f4 = new javax.swing.JButton(); f5 = new javax.swing.JButton(); f6 = new javax.swing.JButton(); f7 = new javax.swing.JButton(); f8 = new javax.swing.JButton(); f9 = new javax.swing.JButton(); f10 = new javax.swing.JButton(); g1 = new javax.swing.JButton(); h1 = new javax.swing.JButton(); g2 = new javax.swing.JButton(); g3 = new javax.swing.JButton(); g4 = new javax.swing.JButton(); g5 = new javax.swing.JButton(); g6 = new javax.swing.JButton(); g7 = new javax.swing.JButton(); g8 = new javax.swing.JButton(); g9 = new javax.swing.JButton(); g10 = new javax.swing.JButton(); h2 = new javax.swing.JButton(); h3 = new javax.swing.JButton(); h4 = new javax.swing.JButton(); h5 = new javax.swing.JButton(); h6 = new javax.swing.JButton(); h7 = new javax.swing.JButton(); h8 = new javax.swing.JButton(); h9 = new javax.swing.JButton(); h10 = new javax.swing.JButton(); jMenuBar1 = new javax.swing.JMenuBar(); jCheckBoxMenuItem1.setSelected(true); jCheckBoxMenuItem1.setText("jCheckBoxMenuItem1"); jMenu1.setText("File"); jMenuBar2.add(jMenu1); jMenu2.setText("Edit"); jMenuBar2.add(jMenu2); jMenu3.setText("jMenu3"); jCheckBoxMenuItem2.setSelected(true); jCheckBoxMenuItem2.setText("jCheckBoxMenuItem2"); jMenu4.setText("File"); jMenuBar3.add(jMenu4); jMenu5.setText("Edit"); jMenuBar3.add(jMenu5); jMenu6.setText("jMenu6"); jMenu7.setText("File"); jMenuBar4.add(jMenu7); jMenu8.setText("Edit"); jMenuBar4.add(jMenu8); jMenu9.setText("File"); jMenuBar5.add(jMenu9); jMenu10.setText("Edit"); jMenuBar5.add(jMenu10); jMenu11.setText("File"); jMenuBar6.add(jMenu11); jMenu12.setText("Edit"); jMenuBar6.add(jMenu12); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); chartLbl.setFont(new java.awt.Font("Arial", 1, 48)); // NOI18N chartLbl.setForeground(new java.awt.Color(255, 51, 51)); chartLbl.setText("Air Canada"); aisle1.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N aisle1.setForeground(new java.awt.Color(255, 0, 0)); aisle1.setText("1"); aisle2.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N aisle2.setForeground(new java.awt.Color(255, 0, 0)); aisle2.setText("2"); aisle3.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N aisle3.setForeground(new java.awt.Color(255, 0, 0)); aisle3.setText("3"); aisle4.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N aisle4.setForeground(new java.awt.Color(255, 0, 0)); aisle4.setText("4"); aisle6.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N aisle6.setForeground(new java.awt.Color(255, 0, 0)); aisle6.setText("6"); aisle5.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N aisle5.setForeground(new java.awt.Color(255, 0, 0)); aisle5.setText("5"); aisle7.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N aisle7.setForeground(new java.awt.Color(255, 0, 0)); aisle7.setText("7"); aisle8.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N aisle8.setForeground(new java.awt.Color(255, 0, 0)); aisle8.setText("8"); aisle9.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N aisle9.setForeground(new java.awt.Color(255, 0, 0)); aisle9.setText("9"); aisle10.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N aisle10.setForeground(new java.awt.Color(255, 0, 0)); aisle10.setText("10"); manifest.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N manifest.setForeground(new java.awt.Color(255, 51, 51)); manifest.setText("VIEW MANIFEST"); manifest.setBorderPainted(false); manifest.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { manifestActionPerformed(evt); } }); waitlist.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N waitlist.setForeground(new java.awt.Color(255, 51, 51)); waitlist.setText("VIEW WAITLIST"); waitlist.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { waitlistActionPerformed(evt); } }); exitBtn.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N exitBtn.setForeground(new java.awt.Color(255, 51, 51)); exitBtn.setText("Exit"); exitBtn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { exitBtnActionPerformed(evt); } }); a1.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N a1.setText("A"); b1.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N b1.setText("B"); a2.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N a2.setText("A"); a3.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N a3.setText("A"); a4.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N a4.setText("A"); a5.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N a5.setText("A"); a6.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N a6.setText("A"); a7.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N a7.setText("A"); a8.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N a8.setText("A"); a9.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N a9.setText("A"); a10.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N a10.setText("A"); b2.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N b2.setText("B"); b3.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N b3.setText("B"); b4.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N b4.setText("B"); b5.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N b5.setText("B"); b6.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N b6.setText("B"); b7.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N b7.setText("B"); b8.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N b8.setText("B"); b9.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N b9.setText("B"); b10.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N b10.setText("B"); c1.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N c1.setText("C"); c2.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N c2.setText("C"); c3.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N c3.setText("C"); c4.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N c4.setText("C"); c5.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N c5.setText("C"); c6.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N c6.setText("C"); c7.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N c7.setText("C"); c8.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N c8.setText("C"); c9.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N c9.setText("C"); c10.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N c10.setText("C"); d1.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N d1.setText("D"); e1.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N e1.setText("E"); f1.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N f1.setText("F"); d2.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N d2.setText("D"); d3.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N d3.setText("D"); d4.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N d4.setText("D"); d5.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N d5.setText("D"); d6.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N d6.setText("D"); d7.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N d7.setText("D"); d8.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N d8.setText("D"); d9.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N d9.setText("D"); d10.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N d10.setText("D"); e2.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N e2.setText("E"); e3.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N e3.setText("E"); e4.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N e4.setText("E"); e5.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N e5.setText("E"); e6.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N e6.setText("E"); e7.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N e7.setText("E"); e8.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N e8.setText("E"); e9.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N e9.setText("E"); e10.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N e10.setText("E"); f2.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N f2.setText("F"); f3.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N f3.setText("F"); f4.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N f4.setText("F"); f5.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N f5.setText("F"); f6.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N f6.setText("F"); f7.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N f7.setText("F"); f8.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N f8.setText("F"); f9.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N f9.setText("F"); f10.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N f10.setText("F"); g1.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N g1.setText("G"); h1.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N h1.setText("H"); g2.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N g2.setText("G"); g3.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N g3.setText("G"); g4.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N g4.setText("G"); g5.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N g5.setText("G"); g6.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N g6.setText("G"); g7.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N g7.setText("G"); g8.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N g8.setText("G"); g9.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N g9.setText("G"); g10.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N g10.setText("G"); h2.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N h2.setText("H"); h3.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N h3.setText("H"); h4.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N h4.setText("H"); h5.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N h5.setText("H"); h6.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N h6.setText("H"); h7.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N h7.setText("H"); h8.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N h8.setText("H"); h9.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N h9.setText("H"); h10.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N h10.setText("H"); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(aisle1, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(aisle2, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(aisle3, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(aisle4, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(aisle6, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(aisle5, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(aisle7, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(aisle8, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(aisle9, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(aisle10, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(a1, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(b1, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addComponent(a2, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(b2, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addComponent(a3, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(b3, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addComponent(a4, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(b4, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addComponent(a5, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(b5, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addComponent(a6, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(b6, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addComponent(a7, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(b7, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addComponent(a8, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(b8, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addComponent(a9, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(b9, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addComponent(a10, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(b10, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(30, 30, 30) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(layout.createSequentialGroup() .addComponent(c1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(d1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(e1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(c8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(d8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addComponent(c7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(d7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addComponent(c6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(d6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addComponent(c5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(d5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addComponent(c4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(d4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addComponent(c3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(d3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addComponent(c2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(d2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addComponent(c9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(d9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addComponent(c10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(d10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(e2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(e3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(e4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(e5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(e6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(e7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(e8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(e9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(e10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(f2) .addComponent(f3) .addComponent(f4) .addComponent(f5) .addComponent(f6) .addComponent(f7) .addComponent(f9) .addComponent(f10) .addComponent(f8) .addComponent(f1)) .addGap(35, 35, 35) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(layout.createSequentialGroup() .addComponent(g1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(h1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addComponent(g3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(h3)) .addGroup(layout.createSequentialGroup() .addComponent(g4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(h4)) .addGroup(layout.createSequentialGroup() .addComponent(g5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(h5)) .addGroup(layout.createSequentialGroup() .addComponent(g6) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(h6)) .addGroup(layout.createSequentialGroup() .addComponent(g7) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(h7)) .addGroup(layout.createSequentialGroup() .addComponent(g8) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(h8)) .addGroup(layout.createSequentialGroup() .addComponent(g9) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(h9)) .addGroup(layout.createSequentialGroup() .addComponent(g10) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(h10)) .addGroup(layout.createSequentialGroup() .addComponent(g2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(h2)))) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(chartLbl) .addComponent(waitlist)) .addGap(36, 36, 36) .addComponent(exitBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addGap(34, 34, 34) .addComponent(manifest))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(27, 27, 27) .addComponent(chartLbl) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(aisle1) .addComponent(a1, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(b1, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(c1, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(d1, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(e1, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(f1, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(aisle2) .addComponent(a2, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(b2, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(c2, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(d2, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(e2, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(f2, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(aisle3) .addComponent(a3, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(b3, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(c3, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(d3, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(e3, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(f3, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(aisle4) .addComponent(a4, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(b4, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(c4, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(d4, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(e4, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(f4, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(a5, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(b5, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(c5, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(d5, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(e5, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(f5, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))) .addComponent(aisle5)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(aisle6) .addComponent(a6, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(b6, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(c6, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(d6, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(e6, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(f6, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(aisle7) .addComponent(a7, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(b7, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(c7, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(d7, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(e7, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(f7, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(aisle8) .addComponent(a8, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(b8, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(c8, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(d8, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(e8, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(f8, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(aisle9) .addComponent(a9, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(b9, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(c9, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(d9, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(e9, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(f9, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(aisle10) .addComponent(a10, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(b10, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(c10, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(d10, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(e10, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(f10, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(g1, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(h1, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(h2, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(g2, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(g3, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(h3, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(g4, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(h4, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(g5, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(h5, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(g6, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(h6, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(g7, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(h7, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(g8, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(h8, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(g9, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(h9, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(g10, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(h10, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 30, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(manifest) .addComponent(waitlist) .addComponent(exitBtn)) .addGap(26, 26, 26)) ); pack(); }// private void buttonActionPerformedCommon(javax.swing.JButton btn, java.awt.event.ActionEvent evt, String seat) { //get first name String firstName = javax.swing.JOptionPane.showInputDialog(null, "Please enter your first name.", "Information Required", JOptionPane.INFORMATION_MESSAGE); // if input is empty, exit if (firstName.isEmpty()) { } else { System.out.println(firstName); //get last name String lastName = javax.swing.JOptionPane.showInputDialog(null, "Please enter your last name.", "Information Required", JOptionPane.INFORMATION_MESSAGE); // if input is empty, exit if (lastName.isEmpty()) { } else { System.out.println(lastName); //output, ___ has been assigned to seat ____ JOptionPane.showMessageDialog(rootPane, firstName + " " + lastName + " has been assigned to seat " + seat + "!", "YAY", JOptionPane.INFORMATION_MESSAGE); //change colour of button btn.setBackground(Color.red); //keep text black btn.setForeground(Color.black); //change text to X btn.setText("X"); //ADDED addSeat(firstName, lastName, seat); while (btn.isSelected()) { int result = JOptionPane.showConfirmDialog(null, "Would you like to remove " + firstName + " " + lastName + " form " + seat + "? ", "Replace?", JOptionPane.YES_NO_OPTION); if (result == JOptionPane.YES_OPTION) { System.exit(0); } } } } } private void exitBtnActionPerformed(java.awt.event.ActionEvent evt) { //exit program int result = JOptionPane.showConfirmDialog(null,"Would you like to exit?", "Exit?", JOptionPane.YES_NO_OPTION); if (result == JOptionPane.YES_OPTION) { System.exit(0);} } private void manifestActionPerformed(java.awt.event.ActionEvent evt) { //Open Manifest //p2 = plan 2 Manifest p2 = new Manifest(allSeats); //get names writeNamesInFile(allSeats); //display frame p2.show(); //https://www.youtube.com/watch?v=3dlvseTkRHg link for where I learned how to open another Jframe } private void waitlistActionPerformed(java.awt.event.ActionEvent evt) { //Open Manifest //p3 = plan 3 Waitlist p3 = new Waitlist(); //display frame p3.show(); } public void checkFile() { try { if (nameSave.exists() == false) { nameSave.createNewFile(); } } catch (IOException e) { JOptionPane.showMessageDialog(rootPane, "File not found"); e.printStackTrace(); } } /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Chart.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Chart.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Chart.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Chart.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } // // // // // // // // /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Chart().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton a1; private javax.swing.JButton a10; private javax.swing.JButton a2; private javax.swing.JButton a3; private javax.swing.JButton a4; private javax.swing.JButton a5; private javax.swing.JButton a6; private javax.swing.JButton a7; private javax.swing.JButton a8; private javax.swing.JButton a9; private javax.swing.JLabel aisle1; private javax.swing.JLabel aisle10; private javax.swing.JLabel aisle2; private javax.swing.JLabel aisle3; private javax.swing.JLabel aisle4; private javax.swing.JLabel aisle5; private javax.swing.JLabel aisle6; private javax.swing.JLabel aisle7; private javax.swing.JLabel aisle8; private javax.swing.JLabel aisle9; private javax.swing.JButton b1; private javax.swing.JButton b10; private javax.swing.JButton b2; private javax.swing.JButton b3; private javax.swing.JButton b4; private javax.swing.JButton b5; private javax.swing.JButton b6; private javax.swing.JButton b7; private javax.swing.JButton b8; private javax.swing.JButton b9; private javax.swing.JButton c1; private javax.swing.JButton c10; private javax.swing.JButton c2; private javax.swing.JButton c3; private javax.swing.JButton c4; private javax.swing.JButton c5; private javax.swing.JButton c6; private javax.swing.JButton c7; private javax.swing.JButton c8; private javax.swing.JButton c9; private javax.swing.JLabel chartLbl; private javax.swing.JButton d1; private javax.swing.JButton d10; private javax.swing.JButton d2; private javax.swing.JButton d3; private javax.swing.JButton d4; private javax.swing.JButton d5; private javax.swing.JButton d6; private javax.swing.JButton d7; private javax.swing.JButton d8; private javax.swing.JButton d9; private javax.swing.JButton e1; private javax.swing.JButton e10; private javax.swing.JButton e2; private javax.swing.JButton e3; private javax.swing.JButton e4; private javax.swing.JButton e5; private javax.swing.JButton e6; private javax.swing.JButton e7; private javax.swing.JButton e8; private javax.swing.JButton e9; private javax.swing.JButton exitBtn; private javax.swing.JButton f1; private javax.swing.JButton f10; private javax.swing.JButton f2; private javax.swing.JButton f3; private javax.swing.JButton f4; private javax.swing.JButton f5; private javax.swing.JButton f6; private javax.swing.JButton f7; private javax.swing.JButton f8; private javax.swing.JButton f9; private javax.swing.JButton g1; private javax.swing.JButton g10; private javax.swing.JButton g2; private javax.swing.JButton g3; private javax.swing.JButton g4; private javax.swing.JButton g5; private javax.swing.JButton g6; private javax.swing.JButton g7; private javax.swing.JButton g8; private javax.swing.JButton g9; private javax.swing.JButton h1; private javax.swing.JButton h10; private javax.swing.JButton h2; private javax.swing.JButton h3; private javax.swing.JButton h4; private javax.swing.JButton h5; private javax.swing.JButton h6; private javax.swing.JButton h7; private javax.swing.JButton h8; private javax.swing.JButton h9; private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItem1; private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItem2; private javax.swing.JMenu jMenu1; private javax.swing.JMenu jMenu10; private javax.swing.JMenu jMenu11; private javax.swing.JMenu jMenu12; private javax.swing.JMenu jMenu2; private javax.swing.JMenu jMenu3; private javax.swing.JMenu jMenu4; private javax.swing.JMenu jMenu5; private javax.swing.JMenu jMenu6; private javax.swing.JMenu jMenu7; private javax.swing.JMenu jMenu8; private javax.swing.JMenu jMenu9; private javax.swing.JMenuBar jMenuBar1; private javax.swing.JMenuBar jMenuBar2; private javax.swing.JMenuBar jMenuBar3; private javax.swing.JMenuBar jMenuBar4; private javax.swing.JMenuBar jMenuBar5; private javax.swing.JMenuBar jMenuBar6; private javax.swing.JButton manifest; private javax.swing.JButton waitlist; // End of variables declaration }
Seat:
/* * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template */ package air.canada; import java.util.Comparator; /** * @author sprince */ // Create Seat Class public class Seat { //to be used in code private String seat; private String firstName; private String lastName; private boolean occupied; //Create constructor public Seat() { firstName = ""; lastName = ""; occupied = false; } //Create Getter and setters public String getSeat() { return seat; } public void setSeat(String seat) { this.seat = seat; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } //create other functions public void addPassenger(String first, String last) { firstName = first; lastName = last; occupied = true; } public String getName() { if (occupied) { return "this seat is booked by " + firstName + " " + lastName; } else { return "Empty Seat"; } } public boolean hasPassenger() { return occupied; } public void removePassenger() { firstName = ""; lastName = ""; occupied = false; } //Create nameCompare that will sort arrayList by passengers first name public static Comparator nameCompare = (Seat s1, Seat s2) -> (int) (s1.getFirstName().compareToIgnoreCase(s2.getFirstName())); //Create seatCompare that will sort arrayList by passengers seat num public static Comparator seatCompare = (Seat s1, Seat s2) -> (int) (s1.getSeat().compareToIgnoreCase(s2.getSeat())); }
Passenger:
/* * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template */ package air.canada; /** * * @author sprince */ public class Passenger { private String firstName; private String lastName; private String seatNum; private String aisle; private String name; private int rowNum; int SORT_BY_NAME; int SORT_BY_SEAT; int sortValue; Passenger() { this.firstName = ""; this.lastName = ""; this.seatNum = ""; this.aisle = ""; this.name = ""; this.rowNum = 0; } // Parameterised constructor // Used to initialize first and last name Passenger(String first, String last){ this.firstName = first; this.lastName = last; this.name = first + last; } // Parameterized constructor // Used to initialize first and last name and row and aisle Passenger(String first, String last, int row, String aisle){ this.firstName = first; this.lastName = last; this.rowNum = row; this.aisle = aisle; this.name = first + last; } // Compare 2 objects int compareTo(Passenger p){ if (this == p) return 1; return 0; } // Getters String getAisle(){ return this.aisle;} String getFirstname(){ return this.firstName;} String getLastName(){ return this.lastName;} String getName(){ return name;} int getRowNum(){ return this.rowNum;} String getSeatNum(){ return this.seatNum;} // Setters void setAisle(String letter){ this.aisle = letter;} void setFirstName(String first){ this.firstName = first;} void setLastName(String last){ this.lastName = last;} void setName(String first, String last){ this.name = this.firstName + this.lastName;} void setRowNum(int num){ this.rowNum = num;} void setSeatNum(String seatNum){ this.seatNum = seatNum;} // return in String public String toString() { return "Name : " + this.getName() + " Aisle : " + this.getAisle() + " Row No. : " + this.getRowNum() + " Seat No. : " + this.getSeatNum();} }
Manifest:
/* * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template */ package air.canada; import java.awt.*; import java.util.ArrayList; import java.util.Collections; import javax.swing.JOptionPane; /** * * @author sprince */ public class Manifest extends javax.swing.JFrame { //Create an arraylist of Seat ArrayList allSeatsList = new ArrayList<>(); //Added constructor with parameters public Manifest(ArrayList allSeatsList) { this.allSeatsList = allSeatsList; initComponents(); } //prints passengers from Chart class public void setOutputArea(ArrayList allSeatsList) { //Create an empty string String strOutput = ""; //Getting info from arraylist for (int i = 0; i < allSeatsList.size(); i++) { //append to set output strOutput = strOutput + allSeatsList.get(i).getFirstName() + "t" + allSeatsList.get(i).getLastName() + "t" + allSeatsList.get(i).getSeat() + " "; } //output outputArea.setText(strOutput); } //https://www.ibm.com/docs/en/i/7.3?topic=toolkit-selecting-awt-mode public Manifest() throws HeadlessException { initComponents(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // private void initComponents() { titleLbl = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); outputArea = new javax.swing.JTextArea(); name = new javax.swing.JButton(); seat = new javax.swing.JButton(); sortLbl = new javax.swing.JLabel(); exitBtn = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); titleLbl.setFont(new java.awt.Font("Arial", 0, 36)); // NOI18N titleLbl.setForeground(new java.awt.Color(255, 0, 51)); titleLbl.setText("Flight Manifest"); outputArea.setColumns(20); outputArea.setRows(5); jScrollPane1.setViewportView(outputArea); name.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N name.setForeground(new java.awt.Color(255, 0, 0)); name.setText("NAME"); name.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { nameActionPerformed(evt); } }); seat.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N seat.setForeground(new java.awt.Color(255, 0, 0)); seat.setText("SEAT"); seat.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { seatActionPerformed(evt); } }); sortLbl.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N sortLbl.setForeground(new java.awt.Color(255, 0, 0)); sortLbl.setText("Sort by:"); exitBtn.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N exitBtn.setForeground(new java.awt.Color(255, 0, 0)); exitBtn.setText("EXIT"); exitBtn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { exitBtnActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(12, 12, 12) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jScrollPane1) .addGroup(layout.createSequentialGroup() .addComponent(sortLbl, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(name, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(seat, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(exitBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(titleLbl, javax.swing.GroupLayout.PREFERRED_SIZE, 243, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(49, 49, 49)))) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(18, 18, 18) .addComponent(titleLbl) .addGap(18, 18, 18) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 355, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(name) .addComponent(seat) .addComponent(sortLbl)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 10, Short.MAX_VALUE) .addComponent(exitBtn) .addContainerGap()) ); pack(); }// private void exitBtnActionPerformed(java.awt.event.ActionEvent evt) { //exit program int result = JOptionPane.showConfirmDialog(null,"Would you like to exit the Manifest?", "Exit?", JOptionPane.YES_NO_OPTION); if (result == JOptionPane.YES_OPTION) { //exit manifest without closing the whole program dispose();} } private void nameActionPerformed(java.awt.event.ActionEvent evt) { //Sort array by name Collections.sort(allSeatsList, Seat.nameCompare); //output setOutputArea(allSeatsList); } private void seatActionPerformed(java.awt.event.ActionEvent evt) { //Sort array by seat Collections.sort(allSeatsList, Seat.seatCompare); //output setOutputArea(allSeatsList); } /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Manifest.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Manifest.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Manifest.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Manifest.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } // // // // // // // // /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Manifest().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton exitBtn; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JButton name; private javax.swing.JTextArea outputArea; private javax.swing.JButton seat; private javax.swing.JLabel sortLbl; private javax.swing.JLabel titleLbl; // End of variables declaration }
Waitlist:
/* * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template */ package air.canada; import java.io.File; import java.io.IOException; import java.util.ArrayList; import javax.swing.JOptionPane; /** * * @author sprince */ public class Waitlist extends javax.swing.JFrame { ArrayList nameList = new ArrayList(); File nameSave = new File("waitList.txt"); /** * Creates new form Waitlist */ public Waitlist() { initComponents(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // private void initComponents() { titleLbl = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); outputArea = new javax.swing.JTextArea(); addBtn = new javax.swing.JButton(); removeBtn = new javax.swing.JButton(); exitBtn = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); titleLbl.setFont(new java.awt.Font("Arial", 0, 36)); // NOI18N titleLbl.setForeground(new java.awt.Color(255, 0, 51)); titleLbl.setText("Waitlist"); outputArea.setColumns(20); outputArea.setRows(5); jScrollPane1.setViewportView(outputArea); addBtn.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N addBtn.setForeground(new java.awt.Color(255, 0, 0)); addBtn.setText("ADD"); addBtn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { addBtnActionPerformed(evt); } }); removeBtn.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N removeBtn.setForeground(new java.awt.Color(255, 0, 0)); removeBtn.setText("REMOVE"); removeBtn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { removeBtnActionPerformed(evt); } }); exitBtn.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N exitBtn.setForeground(new java.awt.Color(255, 0, 0)); exitBtn.setText("EXIT"); exitBtn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { exitBtnActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1) .addComponent(exitBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addComponent(addBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(removeBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addContainerGap()) .addGroup(layout.createSequentialGroup() .addGap(135, 135, 135) .addComponent(titleLbl) .addContainerGap(136, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(7, 7, 7) .addComponent(titleLbl) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 355, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(removeBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(addBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(exitBtn) .addContainerGap()) ); pack(); }// private void addBtnActionPerformed(java.awt.event.ActionEvent evt) { //Get Info String firstName = JOptionPane.showInputDialog(null, "Please enter your first name.", "Information Required", JOptionPane.INFORMATION_MESSAGE); if (firstName.isEmpty()) { }else{ String lastName = JOptionPane.showInputDialog(null, "Please enter your last name.", "Information Required", JOptionPane.INFORMATION_MESSAGE); if (lastName.isEmpty()) { }else{ ArrayList tempRow = new ArrayList(); // add info to array tempRow.add(firstName); tempRow.add(lastName); //add temp list to global nameList.add(tempRow); //output outputArea.append(" "+"Added Successfully!");} //print placeholders//clear previous outputArea.setText("First NametLast NamettPriority "); //loop through each row//print colums for(int row = 0; row tempRow = nameList.get(row); //print to area outputArea.append(" "+tempRow.get(0)+"t"); outputArea.append(tempRow.get(1)+"t"); outputArea.append("t" + (row + 1) + "t"); } } } private void exitBtnActionPerformed(java.awt.event.ActionEvent evt) { //exit program int result = JOptionPane.showConfirmDialog(null,"Would you like to exit the Waitlist?", "Exit?", JOptionPane.YES_NO_OPTION); if (result == JOptionPane.YES_OPTION) { //exit waitlist without closing the whole program dispose();} } private void removeBtnActionPerformed(java.awt.event.ActionEvent evt) { // if array is empty removal not possible if (nameList.isEmpty()) { JOptionPane.showMessageDialog(null, "No names to remove.", "Error", JOptionPane.ERROR_MESSAGE); } else { //Get first name String firstName = JOptionPane.showInputDialog(null, "Please enter your first name.", "Information Required", JOptionPane.INFORMATION_MESSAGE); //if empty exit if (firstName.isEmpty()) { //do nothing } else { //get last name String lastName = JOptionPane.showInputDialog(null, "Please enter your la
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Chartjava java import javaioFile import javaioFileWriter import javaxswingJFrame import javaxswingJL...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started