title: I can't make square apear in my gui. Can some one explain what exactly is wrong there?
body: <p>I'm trying to draw rectangle to my gui but nothing shows up</p>
  
  <p>I've tried using repaint(); and blackJackPanel.add(repaint()); which makes no sense but im desperate. There are 2 classes which are menu page I won't post roulette class because it's just too long. Everything works fine except blackjack class where i can't make that square appear.</p>
  
  <pre class="lang-java prettyprint-override"><code>
  import javax.swing.*;
  import java.awt.*;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  import java.awt.geom.Rectangle2D;
  
  public class BlackJack extends JPanel implements ActionListener {
      JPanel blackjackPanel = new JPanel();
      JMenu menu = new JMenu("Gry");
      JMenuItem menuRuletka = new JMenuItem("Ruletka");
      JMenuItem mainMenu = new JMenuItem("MainMenu");
      JMenuBar menuBar = new JMenuBar();
  
      public void entireBlackJackQueue(){
          panelConfig();
          menuConfiguration();
  
      }
  
      public void panelConfig(){
          blackjackPanel.setLayout(null);
  
      }
      public void menuConfiguration() {
          menuBar.setBounds(0, 0, 40, 20);
          menu.add(mainMenu);
          menu.add(menuRuletka);
          menuBar.add(menu);
          blackjackPanel.add(menuBar);
  
      }
  
      @Override
      public void actionPerformed(ActionEvent e) {
  
      }
  
      protected void paintComponent(Graphics g) {
          super.paintComponent(g);
          g.drawRect(230,80,10,10);
          g.setColor(Color.RED);
          g.fillRect(230,80,10,10);
      }
  }
  </code></pre>
  
  <pre class="lang-java prettyprint-override"><code>
  
  import javax.swing.*;
  import java.awt.*;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  import java.awt.event.KeyEvent;
  
  public class MyFrame extends JFrame implements ActionListener {
      JMenu menu = new JMenu("Gry");
      JMenuItem menuRuletka = new JMenuItem("Ruletka");
      JMenuItem menuBlackJack = new JMenuItem("BlackJack");
      JFrame frame = new JFrame("Kasyno");
      Ruletka ruletka = new Ruletka();
      BlackJack blackJack = new BlackJack();
      JMenuBar menuBar = new JMenuBar();
      JPanel mainPanel = new JPanel();
      Main main = new Main();
  
      public MyFrame(){
          frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
          frame.setVisible(true);
          frame.setSize(900,600);
          menuConfiguration();
          mainFrameConfiguration();
          ruletka.entireRuletkaQueue();
          blackJack.entireBlackJackQueue();
          frame.setContentPane(mainPanel);
          frame.setResizable(false);
  
  
      }
      public void mainFrameConfiguration(){
          mainPanel.setLayout(null);
          mainPanel.add(menuBar);
      }
      public void menuConfiguration(){
          menuBar.setBounds(0,0,40,20);
          menuRuletka.addActionListener(this);
          menuBlackJack.addActionListener(this);
          menu.add(menuRuletka);
          menu.add(menuBlackJack);
          menuBar.add(menu);
          ruletka.mainMenu.addActionListener(this);
          blackJack.mainMenu.addActionListener(this);
          blackJack.menuRuletka.addActionListener(this);
          ruletka.menuBlackJack.addActionListener(this);
      }
  
      @Override
      public void actionPerformed(ActionEvent e) {
          Object source = e.getSource();
          if(source==menuRuletka){
                  frame.remove(mainPanel);
                  frame.setContentPane(ruletka.ruletkaPanel);
                  frame.validate();
                  frame.repaint();
          }
          if(source==ruletka.mainMenu){
              frame.setContentPane(mainPanel);
              frame.remove(ruletka.ruletkaPanel);
              frame.validate();
              frame.repaint();
          }
          if(source==menuBlackJack){
              frame.setContentPane(blackJack.blackjackPanel);
              frame.remove(mainPanel);
              frame.validate();
              frame.repaint();
          }
          if(source==blackJack.mainMenu){
              frame.setContentPane(mainPanel);
              frame.remove(blackJack.blackjackPanel);
              frame.validate();
              frame.repaint();
          }
          if(source==blackJack.menuRuletka){
              frame.setContentPane(ruletka.ruletkaPanel);
              frame.remove(blackJack.blackjackPanel);
              frame.validate();
              frame.repaint();
          }
          if(source==ruletka.menuBlackJack){
              frame.setContentPane(blackJack.blackjackPanel);
              frame.remove(ruletka.ruletkaPanel);
              frame.validate();
              frame.repaint();
          }
      }
  }
  
  </code></pre>
  
  <pre class="lang-java prettyprint-override"><code>import java.awt.*;
  
  public class Main {
  
      int saldo=1000;
  
      public void setSaldo(int saldo) {
          this.saldo = saldo;
      }
  
      public int getSaldo() {
          return saldo;
      }
  
      public static void main(String[] args) {
          EventQueue.invokeLater(new Runnable() {
              @Override
              public void run() {
                  new MyFrame();
              }
          });
  
  
      }
  }
  
  if that square will be able to apear that would be great!
  </code></pre>