title: Java GUI not showing anything
body: <p>I am new to Java and I am creating a Gui. I don't have any error but when I ran the main nothing is shown.
  I can not understand why. Can please someone help?</p>
  
  <p>Here is my code of the GUI: </p>
  
  <pre><code>import java.awt.*;
  import java.awt.event.*;
  import javax.swing.*;
  import javax.swing.border.Border;
  
  public class DartsGUI implements ActionListener {
  
      //Gui components
      JFrame mainDartsFrame;
      JPanel buttonsPanel,infoPanel;
      JRadioButton viewTableAsc,viewTableDesc,editScores,viewDetails,searchById;
      CardLayout cLayout;
      JTextArea table1,table2;
      JScrollPane scrollTable1,scrollTable2;
      JLabel edit,details,search;
  
      public void DartGUI() {
          mainDartsFrame= new JFrame("Darts Competition");
          mainDartsFrame.setSize(700, 500);
          mainDartsFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          mainDartsFrame.setLayout(new BorderLayout());
          mainDartsFrame.setLocationRelativeTo(null);
          createButtonsPanel();
          createInfoPanel();
          mainDartsFrame.setVisible(true);
      }
  
      private void createButtonsPanel() {
          JPanel buttonsPanel = new JPanel( new GridLayout(5,1) );
          viewTableAsc= new JRadioButton("Info Ascending Order");
          viewTableAsc.addActionListener(this);
          viewTableDesc= new JRadioButton("Info Descending Order");
          viewTableDesc.addActionListener(this);
          editScores= new JRadioButton("Edit Scores");
          editScores.addActionListener(this);
          viewDetails= new JRadioButton("View Details");
          viewDetails.addActionListener(this);
          searchById=new JRadioButton("Search Competitor");
          searchById.addActionListener(this);
  
          //Group radio buttons to ensure only one is chosen each time
          ButtonGroup radioButtons = new ButtonGroup();
          radioButtons.add(searchById);
          radioButtons.add(viewTableAsc);
          radioButtons.add(viewTableDesc);
          radioButtons.add(editScores);
          radioButtons.add(viewDetails);
          //Push buttons into the buttons Panel
          buttonsPanel.add(viewTableAsc);                    
          buttonsPanel.add(viewTableDesc);                            
          buttonsPanel.add(editScores);                        
          buttonsPanel.add(viewDetails);                            
          buttonsPanel.add(searchById);                            
  
          mainDartsFrame.add(buttonsPanel,BorderLayout.WEST);
      }
  
      private void createInfoPanel() {
          infoPanel = new JPanel();
          cLayout = new CardLayout();
          infoPanel.setLayout(cLayout);
          table1 = new JTextArea(10,10);
          table1.setEditable(false);
          scrollTable1 = new JScrollPane(table1);
          table2 = new JTextArea(10,10);
          table2.setEditable(false);
          scrollTable2 = new JScrollPane(table1);
          edit = new JLabel("Edit Scores");
          search= new JLabel("Search Id");
          details=new JLabel("View Details");
  
          infoPanel.add(scrollTable1, "viewTable1");
          infoPanel.add(scrollTable2, "viewTable2");
          infoPanel.add(edit, "edit");
          infoPanel.add(search, "searchId");
          infoPanel.add(details, "viewDetails");
  
          mainDartsFrame.add(infoPanel,BorderLayout.CENTER);
      }
  
      public void actionPerformed (ActionEvent e) {
          JRadioButton eventButton = (JRadioButton) e.getSource();
  
          if(eventButton==viewTableAsc){
              cLayout.show(infoPanel,"viewTable1");
          }
          else if(eventButton==viewTableDesc){
              cLayout.show(infoPanel, "viewTable2");
          }
          else if(eventButton==editScores){
              cLayout.show(infoPanel, "edit");
          }
          else if(eventButton==viewDetails){
              cLayout.show(infoPanel, "viewDetails");
          }
          else{
              cLayout.show(infoPanel, "searchId");
          }
      }
  }
  </code></pre>
  
  <p>And the main class:</p>
  
  <pre><code>public class mainGui {
  
      public static void main(String[] args) {
          DartsGUI gui = new DartsGUI();
      }
  }
  </code></pre>