How to set Defalut radio button selection in HSB panel in JColorchooser

hi all, i developed a new colorchooser using JColorChooser, but now i need to change the HSB panel view, by defalut " H " radio button is selected in HSB panel BUT my requirement is " B " radio button should be selected by defalut.Thanks in Advance...
[272 byte] By [sekhar.allaa] at [2007-11-27 9:45:15]
# 1

can't see a property you can change (probably is one), but it seems to work OK like this

import javax.swing.*;

import java.awt.*;

import java.awt.event.*;

class Testing

{

public void buildGUI()

{

JColorChooser jcc = new JColorChooser();

JFrame f = new JFrame();

f.getContentPane().add(jcc);

f.pack();

f.setLocationRelativeTo(null);

f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

changeH2B(jcc.getComponents());

f.setVisible(true);

}

public void changeH2B(Component[] comps)

{

for(int x = 0,y = comps.length; x < y; x++)

{

if(comps[x] instanceof JRadioButton)

{

if(((JRadioButton)comps[x]).getText().equals("B"))

{

((JRadioButton)comps[x]).doClick();

return;

}

}

else if(comps[x] instanceof Container) changeH2B(((Container)comps[x]).getComponents());

}

}

public static void main(String[] args)

{

SwingUtilities.invokeLater(new Runnable(){

public void run(){

new Testing().buildGUI();

}

});

}

}

Michael_Dunna at 2007-7-12 23:53:36 > top of Java-index,Desktop,Core GUI APIs...
# 2
Wonderfull output.................Thanks a lot............
sekhar.allaa at 2007-7-12 23:53:36 > top of Java-index,Desktop,Core GUI APIs...