title: Swing Components are not aligned as per layout
body: <p>I am struck in the Swing application. Here is brief problem. I am having a frame and then a panel. I am adding JTabbedPane to panel and adding components on the JTabbedPane. I am setting Grid Layout for the TabbedPane but it is not rendering the components in correct way.</p>
  
  <p>It should render the components as A lable and then text field next to it. But it is rendering a lable and then below that lable a textfield.</p>
  
  <p>Below is the code : </p>
  
  <pre><code>public static void main(String[] args) throws IOException {
  
       File file = new File("C:\\Documents and Settings\\rkumar\\Desktop\\IOSAutomationParameters.properties");
  
       if( file != null ){
  
           Properties property = new Properties();
  
           property.load(new FileInputStream(file));
  
            JFrame frame = new JFrame("IOSAutomationToolFourthPage");
            JPanel framePanel = new JPanel();
            framePanel.setSize(700,700);
             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            String numberOfClients = property.getProperty("numberOfClients");
            System.out.println("number of clients: "+numberOfClients);
            if (!numberOfClients.isEmpty()) {
  
                 int numberOfClientNumb = Integer.parseInt(numberOfClients);
  
                    System.out.println("numberOfClientNumb ::" + numberOfClientNumb);
  
                     JTabbedPane tab = new JTabbedPane();
  
                    // JTabbedPane tab2 = new JTabbedPane();
                  for( int i=1; i&lt;=numberOfClientNumb; i++){
  
                     JPanel panel = new JPanel();
                    panel.setSize(400, 400);
                    panel.setLayout(new GridLayout(10,2,1,1));
  
                    //Remote IP 
                    JLabel remoteIPLbl = new JLabel("Remote IP : ");
                    String remoteIPVal = property.getProperty("remoteIP_"+i);
                    JTextField remoteIPField = new JTextField(remoteIPVal);
                    remoteIPLbl.setBounds(50, 100, 2, 2);
                    remoteIPField.setBounds(200, 100, 2, 2);
                    remoteIPField.setColumns(30);
  
  
                    //Remote User Name
                    JLabel userNameLbl = new JLabel("User Name : ");
                    String userNameVal = property.getProperty("remoteUserName_"+i);
                    JTextField userNameField = new JTextField(userNameVal);
                    userNameLbl.setBounds(50, 200, 2, 2);
                    userNameField.setBounds(200, 200, 2, 2);
                    userNameField.setColumns(20);
  
  
                    //Remote Password
                    JLabel remotePasswordLbl = new JLabel("Remote Password : ");
                    String remotePasswordVal = property.getProperty("remotePassword_"+i);
                    JTextField remotePasswordField = new JTextField(remotePasswordVal);
                    remotePasswordLbl.setBounds(50, 300, 2, 2);
                    remotePasswordField.setBounds(200, 300, 2, 2);
                    remotePasswordField.setColumns(20);
  
  
  
  
                    //Remote Path
                    JLabel remotePathLbl = new JLabel("Remote Path : ");
                    String remotePathVal = property.getProperty("remotePath_"+i);
                    JTextField remotePathField = new JTextField(remotePathVal);
                    remotePathLbl.setBounds(50, 400, 2, 2);
                    remotePathField.setBounds(200, 400, 2, 2);
                    remotePathField.setColumns(100);
  
  
  
  
                    //deviceOrSimulator
                    JLabel deviceOrSimulatorLbl = new JLabel("Device or Simulator : ");
                    String deviceOrSimulatorVal = property.getProperty("deviceOrSimulator_"+i);
                    JTextField deviceOrSimulatorField = new JTextField(deviceOrSimulatorVal);
                    deviceOrSimulatorLbl.setBounds(50, 500, 2, 2);
                    deviceOrSimulatorField.setBounds(200, 500, 2, 2);
                    deviceOrSimulatorField.setColumns(1);
  
  
                    panel.add(remoteIPLbl);
                    panel.add(remoteIPField);
                    panel.add(userNameLbl);
                    panel.add(userNameField);
                    panel.add(remotePasswordLbl);
                    panel.add(remotePasswordField); 
                    panel.add(remotePathLbl);
                    panel.add(remotePathField); 
                    panel.add(deviceOrSimulatorLbl);
                    panel.add(deviceOrSimulatorField); 
  
  
                    tab.add("Client "+i,panel);
                    System.out.println(""+i);                     
                 }
  
                  framePanel.add(tab);
                  frame.add(framePanel);
                 // frame.setLayout(new Lay);
            }
  
            frame.setSize(800, 800);
            frame.setVisible(true);
  
       }
  }
  </code></pre>