Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JRadioButtons in applet

 
shaikat chakraborty
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1.how to hide the border of a JTextarea in an applet.
2.I have added four radio buttons and a Jbutton in an applet.if i select one radio button and press next button the four radio button is comming but the button which was selected remains selected even ihave used the method setSelected(false).
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

Since there seems to be nothing applet-specific in the question, I'll move it to the Swing/SWT forum, where you're more likely to get an answer about this kind of question.
[ August 22, 2008: Message edited by: Ulf Dittmer ]
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by shaikat chakraborty:
1.how to hide the border of a JTextarea in an applet.
2.I have added four radio buttons and a Jbutton in an applet.if i select one radio button and press next button the four radio button is comming but the button which was selected remains selected even ihave used the method setSelected(false).


1) Have you tried JTextArea#setBorder(null) or JTextArea#setBorder(BorderFactory.createEmptyBorder(0,0,0,0)) ? Usually you add a JTextArea to the parent after wrapping it inside a JScrollPane. Check out the API for similar border related methods for the JScrollPane

2) If you have added the buttons to a ButtonGroup and one of them is selected, there is no way you can clear all selections. You need to remove them from the group, clear selections and add them back to the group.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
2)
for java 1.6+
buttonGroup.clearSelection()
will set them all to false
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And for previous versions of Java you can use a JRadioButton that is not shown in the user interface, and set that as the selected button.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic