Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. How to Align Radio Buttons in MigLayout?

How to Align Radio Buttons in MigLayout?

Scheduled Pinned Locked Moved Java
comhelptutorialquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    chdboy
    wrote on last edited by
    #1

    http://i42.tinypic.com/dgl9ns.jpg This is the Image of what I have right now. I want to align Radio Buttons so that It will not have the space left to "Y" ,so that they will align correctly.

    String yesString = "Y";
    String noString = "N";
    JRadioButton yesButton = new JRadioButton(yesString);
    JRadioButton noButton = new JRadioButton(noString);

    And below while adding

    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");
    

    EDIT: I just did this and solved my problem

    panel.add(yesButton,"gapleft 0,split");

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups