aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JRadioButtons in applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JRadioButtons in applet" Watch "JRadioButtons in applet" New topic
Author

JRadioButtons in applet

shaikat chakraborty
Greenhorn

Joined: Aug 22, 2008
Posts: 5
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
Marshal

Joined: Mar 22, 2005
Posts: 41529
    
  53
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 ]

Ping & DNS - my free Android networking tools app
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10255
    
    8

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.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
2)
for java 1.6+
buttonGroup.clearSelection()
will set them all to false
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JRadioButtons in applet