swing - java: how to make srollable panel with radio button and labels inside? -


I got an JScrollPane in which I want to put a list of radio buttons and labels. My problem is that the panel does not scroll I think this is because I did not set a viewport, but how can I set it if I have multiple components? My code looks like this:

  JScrollPane panel = new JScrollPane (); JRDOton Marradeau; Jellabelle Labell; For (Int i = 0; I <100; i ++) {myRadio = New Gerbethton (); MyLabel = new JLabel ("text"); Panel.add (myRadio); Panel.add (mylabel); }  

Thanks.

Labels in your button and one cover jpnil and then Drop in JScrollPane .

Try this:

  JPanel panel = new zpinal (new grid layout (0,1)); JRDOton Marradeau; For (Int i = 0; I  

as well as the button group allows you to apply a single selection barrier to the normal for radio buttons.


Comments