need suggestion about "new JRadioButton"


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: need suggestion about "new JRadioButton"

Threaded View

  1. #1
    Join Date
    Aug 2006
    Posts
    18

    need suggestion about "new JRadioButton"

    hello,
    i'm new in java, and i need suggestion about things below:

    which is better:

    to use
    Code:
    private void try {
      radiobutton1.setSelected(true);
      radiobutton2.setSelected(false);
      radiobutton3.setSelected(false);
    }
    or this one:
    Code:
    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 }
      }
    }
    currently, i'm using the latter in my program, but i'm afraid that it takes lots of memory or
    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
    Last edited by efm; 08-30-2006 at 05:29 AM.

Similar Threads

  1. Suggestion Needed
    By ram_mcse in forum Security
    Replies: 3
    Last Post: 12-01-2006, 11:05 AM
  2. Need your suggestion
    By swapnil_paranja in forum C++
    Replies: 0
    Last Post: 06-23-2005, 07:29 AM
  3. Replies: 0
    Last Post: 06-13-2002, 12:41 AM
  4. e-commerce suggestion...
    By ScottD in forum Architecture and Design
    Replies: 0
    Last Post: 05-24-2002, 06:03 AM
  5. Any Suggestion to this
    By Kamlesh Patel in forum Java
    Replies: 6
    Last Post: 07-09-2001, 08:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center