Results 1 to 1 of 1

Thread: [RESOLVED] How to align RadioButtons in MigLayout?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2012
    Posts
    119

    Resolved [RESOLVED] How to align RadioButtons in MigLayout?

    This is the Image of what I have right now

    Name:  Radio_Button.jpg
Views: 526
Size:  9.3 KB

    I want to align Radio Buttons so that It will not have the space left to "Y" ,so that they will align correctly.

    Code:
    String yesString = "Y";
    	String noString = "N";
    	JRadioButton yesButton = new JRadioButton(yesString);
    	JRadioButton noButton = new JRadioButton(noString);
    And below I add like this
    Code:
    yesButton.setMnemonic(KeyEvent.VK_R);
            yesButton.setActionCommand(yesString);
            yesButton.setSelected(true);       
            
            
            noButton.setMnemonic(KeyEvent.VK_R);
            noButton.setActionCommand(noString);
            
            ButtonGroup group = new ButtonGroup();
            group.add(yesButton);
            
            group.add(noButton);
            
            panel.add(yesButton,"cell 12 12 ,       gap related");        
            panel.add(noButton,"wrap , align label,gapleft 0");
    Last edited by chdboy; Oct 16th, 2013 at 05:38 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width