title: How to change width size of Jpanels in BorderLayout?
body: <p>I have main JPanel which is Borderlayout with added 4 JPANELS: NORTH(Green), WEST(Red), CENTER(Gray), SOUTH(Blue). I want to reduce width size of WEST(Red) Jpanel, or increase width size of Center(Grey) Jpanel.</p>
  
  <p>Screenshot:</p>
  
  <p><a href="https://i.stack.imgur.com/at5GA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/at5GA.png" alt="https://i.stack.imgur.com/at5GA.png"></a></p>
  
  <p>Here is my code:</p>
  
  <pre><code>    frame = new JFrame("FreshPos baza podataka");
      frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
  
      // Main paneel
      JPanel panel = new JPanel();        
      panel.setLayout(new BorderLayout());
      panel.setBorder( BorderFactory.createEmptyBorder(10,10,10,10) );
      frame.getContentPane().add(panel);
  
      //West panel;
      JPanel panelWest = new JPanel(new GridLayout(14,0,0,2));
      panelWest.setPreferredSize(new Dimension(300, 300));    
      panelWest.setBorder( BorderFactory.createEmptyBorder(100,0,0,0) );
      panel.add(panelWest, BorderLayout.WEST);
      panelWest.setBackground(Color.red);
  
      for (int i = 0; i &lt; MAX_TABLES; i++) {          
          buttonsTables[i] = new JButton(tables[i]);          
          buttonsTables[i].setMaximumSize(new Dimension(Integer.MAX_VALUE, buttonsTables[i].getMinimumSize().height));
          panelWest.add(buttonsTables[i]);            
          panelWest.add(Box.createVerticalStrut(10));         
      }       
  
      //South panel;
      JPanel southPanel = new JPanel(); // Donji layout za dugmice    
      southPanel.setBorder( BorderFactory.createEmptyBorder(20,0,0,0) );
      panel.add(southPanel, BorderLayout.SOUTH);  
      southPanel.setBackground(Color.BLUE);
  
      JButton buttonDodaj = new JButton("Dodaj");
      southPanel.add(buttonDodaj);        
      JButton buttonIzmeni = new JButton("Izmeni");
      southPanel.add(buttonIzmeni);       
      JButton butonObrisi = new JButton("Obrisi");
      southPanel.add(butonObrisi);
  
      //North panel;      
      JPanel northPanel = new JPanel(); // Donji layout za dugmice
      northPanel.setBorder( BorderFactory.createEmptyBorder(0,10,0,0) );
      panel.add(northPanel, BorderLayout.NORTH);
      northPanel.setBackground(Color.green);
  
      JButton buttonImport = new JButton("Importuj fajl");
      buttonImport.addActionListener(new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
              importActionPerformed(evt);
          }           
      });
      northPanel.add(buttonImport, BorderLayout.WEST);
  
      JButton ButtonRecord = new JButton("Snimi fajl");
      northPanel.add(ButtonRecord, BorderLayout.WEST);
  
      // Central panel        
      JPanel centerPanel = new JPanel(new BorderLayout());
      centerPanel.setBackground(Color.GRAY);
      panel.add(centerPanel, BorderLayout.CENTER);
  </code></pre>