title: prevent GridBagLayout from resizing columns
body: <p>Another problem with swing. How can I stop GridBagLayout from respacing components if one of them changes size? For example, I have few columns, in one of which there is a JLabel with text "text". When I change it to "texttext" layout manager resizes the whole column. I don't want it to do that. Is there any way to prevent it?</p>
  
  <p>Example:</p>
  
  <pre><code>import javax.swing.*;
  import java.awt.*;
  import java.awt.event.ActionEvent;
  
  public class ResizeIssue {
  
   static int value = 99;
  
   public static void main(String[] args) {
  
      JFrame frame = new JFrame();
      final JLabel valueLabel = new JLabel(String.valueOf(value));
      JButton decButton = new JButton("-");
      decButton.addActionListener(new java.awt.event.ActionListener() {
  
          @Override
          public void actionPerformed(ActionEvent ae) {
              valueLabel.setText(String.valueOf(--value));
          }
      });
  
      JButton incButton = new JButton("+");
      incButton.addActionListener(new java.awt.event.ActionListener() {
  
          @Override
          public void actionPerformed(ActionEvent ae) {
              valueLabel.setText(String.valueOf(++value));
          }
      });
  
    JPanel panel = new JPanel();
    panel.setLayout(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.weightx = 1;
    c.gridx = 0;
    c.gridy = 0;
    panel.add(decButton, c);
    c.gridx = 1;
    panel.add(valueLabel, c);
    c.gridx = 2;
    panel.add(incButton, c);
  
    frame.add(panel);
    frame.pack();
    frame.setVisible(true);
    }
   }
  </code></pre>
  
  <p>It is visible while 9 -> 10 or anytime text changes width.</p>