hello,
i'm new in java, and i need suggestion about things below:
which is better:
to use
or this one:Code:private void try { radiobutton1.setSelected(true); radiobutton2.setSelected(false); radiobutton3.setSelected(false); }
currently, i'm using the latter in my program, but i'm afraid that it takes lots of memory orCode:private void setSelectedRadioButtons(JRadioButton[] rb, boolean[] b) { for (int i=0; i<=rb.length; i++) { rb[i].setSelected(b[i]); } } private void try { setSelectedRadioButtons( new JRadioButton[] { radiobutton1, radiobutton2, radiobutton3 }, new boolean[] { true, false, false } } }
it's a "not suggested" line of code.
if the latter is ok, then i will use it for other components and properties
thank you


Reply With Quote


Bookmarks