Want a better solution for radiobutton code

I am using radio buttons the code works but it seems very long winded any ideas how I can cut down the code?
// code snippet
//basicly decare some JRadioButton
//set action command
currentaccount = new JRadioButton("Current Account");
currentaccount.setMnemonic(KeyEvent.VK_C);
currentaccount.setSelected(true);
currentaccount.setActionCommand(currentACString);
panelRadioButtonAC.add(currentaccount);
savingaccount = new JRadioButton("Saving Account");
// Group the radio buttons.
ButtonGroup group = new ButtonGroup();
group.add(currentaccount);
group.add(savingaccount);
// Register a listener for the radio buttons.
RadioListener myListener = new RadioListener();
currentaccount.addActionListener(myListener);
currentaccount.addActionListener(myListener);
//here is the code check which is very long winded
/* I am checking each radiobutton and then determining if it is true, since I have used a button group isn't there a way I can find out which is chosen????
/** Listens to the radio buttons. */
class RadioListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
if ( e.getActionCommand().equals("Current Account") )
{       curAC = true;
savAC = false;
if( e.getActionCommand().equals("Saving Account") )
{      savAC = true;
debAC = false;
Please help

See my answer in
http://forum.java.sun.com/thread.jsp?forum=54&thread=196354
... and please don't post a question 20 times...
Doug

Similar Messages

  • Old table style that i'm surprised Indesign doesnt have a better solution for

    Hey guys, I had a question about indesign tables. In one publication I am working in, the client has expressed a desire for table to be done the way they always did them which is the following.
    When the table is first being introduced to the reader (that is when it starts) it has a .75 stroke above. however if the header row occurs on any succeding pages, then that stroke should be .25 like any other strokes that may occur on the table (like at the bottom, or the line under the headers.
    This is so simple but right now it has me stumped. Is there any way to do this in an easier fashion than having to convert the header to a body row recreate or fake the header row by putting it into the regular flow of rows? Thanks all!

    Yeah, that's what I'm saying: you can't just apply a stroke to the top of a frame, and if your objects aren't anchored then you risk the possibility of a number of lines randomly floating around. The whole point of anchored objects is to anchor them to a particular point in the text, so when they text reflows they follow along. So: use the pen tool to draw your line, copy it to your clipboard, create an anchored object, manipulate it until it's sitting exactly where you want it, and paste your new rule in.
    Positioning anchored objects precisely works well once you understand the interface, but the first time out I found it really confusing, hence my link to the help file entry on anchored objects.
    There may well be a better solution for your issue, but this duct tape is what came immediately to mind.

  • Blackberry 9300 solution for mep code (0 left)

    Hi
    Blackberry 9300 solution for mep code (0 left)
    Help me please
    Thanks...

    Hi and Welcome to the Forums!
    With zero tries left, there is only one official solution -- sending your BB to the RIM factory to have it totally reset. Your methods of requesting this service are the same as for all BB service...via your wireless service provider. If they refuse or if you have no warranty (due to a variety of reasons, this can be the case), then you must request this via paid incident support:
    http://us.blackberry.com/support/programs/technical/incident.jsp
    Be advised that, while I have no personal experience with this, it is my opinion that the cost of having this done will exceed the cost of just buying a new BB.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • I want better solution for adjusting the Material stock values for the last

    my Customer  need to adjust( Decrease)  the closing stock values for the following materials / plant wise as on 31.03.2006 for meeting statuary compliance.
    Material1 :  RS: 4149599    QTY : 10181.03 Ltrs
    Material 2  : RS: 1318596     QTY:  2152.76   Ltrs
    As per my knowledge MM posting periods can open current month and Previous month only. For the reason I proposed the solution as follows:
    Step 1 : post FI Journal Entry on 31.03.2006
    Opening Balance G/L  Account Dr 4149599 + 1318596
    Closting Stock a/c                      Cr 4149599 + 1318596
    Step 2.
    Change the Material Price in MM through T.Code: MR21
    ( Posting will be allowed in current or previous months)
    This makes our CO reports accurate.
    Please  suggest the better solution if it is possible in MM for adjusting the Material stock values for the last financial year.
    WIth Best Regards,
    Rajesh
    <b></b>

    Hi Madhavan,
    Unfortunately this forum deals with migrations from non-Oracle
    environments to Oracle. You seem to be dealing with migrations in
    an Oracle environment mainly.
    I would recommend that you contact Oracle Applications and RDBMS
    support directly. They will have the most up to date
    information/advice on performing these actions.
    Regards
    John
    Madhavan (guest) wrote:
    : Hi John
    : Thanks for your reply.
    : Actually I am planning to upgrade the system.
    : 1. I Want to Upgrade Oracle Financials release 10.7 to the
    : latest version (11.x)
    : 2. Oracle 7 database to oracle 8 or 8i.
    : 3. Oracle is running on NT service pack 3. Do I need to upgrade
    : this?. If not what is the impact on Windows NT?
    : 4. Is the majority still running smart client 10.7 and database
    : 7?
    : 5. What is the necessary time to implement these upgrades? What
    : type of consulting I need to have?
    : 6. I have some employees working on it? Will these changes
    : affect them?
    : What type of precautions I need to take on the whole??
    : Thank You
    : Madhavan
    Oracle Technology Network
    http://technet.oracle.com
    null

  • Any solutions for error code r6034

    anyone find a solution for fixing error code r6034?

    Hi fcianci,
    If you are having issues with iTunes after an attempted update, you may find the following article helpful:
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    Regards,
    - Brenden

  • Better solution for scaling of value

    Hi,
    We have a requirement of scaling the values retrieved in reports, We had two solutions,
    1) Use EvGTS function to scale vale
    2) Use Excel functionality to scale the value
    Please let us know which is a better solution.
    Thanks & Regards,
    Ramanathan

    Hi Ramanathan,
    You can use EvGTS function, because it retrieves the data and also scales the values.
    Regards,
    Raghu

  • Want better Solution for Migration?

    Hi I am Madhavan
    I Need some guidelines to have a better migration solution.
    We have oracle financials running on Windows NT platform. For
    application side we are using smart client and oracle 7 as the
    database. How to upgrade and migrate the entire system ,keeping
    cost in mind.
    Thank You
    Madhavan.S
    null

    Hi Madhavan,
    Unfortunately this forum deals with migrations from non-Oracle
    environments to Oracle. You seem to be dealing with migrations in
    an Oracle environment mainly.
    I would recommend that you contact Oracle Applications and RDBMS
    support directly. They will have the most up to date
    information/advice on performing these actions.
    Regards
    John
    Madhavan (guest) wrote:
    : Hi John
    : Thanks for your reply.
    : Actually I am planning to upgrade the system.
    : 1. I Want to Upgrade Oracle Financials release 10.7 to the
    : latest version (11.x)
    : 2. Oracle 7 database to oracle 8 or 8i.
    : 3. Oracle is running on NT service pack 3. Do I need to upgrade
    : this?. If not what is the impact on Windows NT?
    : 4. Is the majority still running smart client 10.7 and database
    : 7?
    : 5. What is the necessary time to implement these upgrades? What
    : type of consulting I need to have?
    : 6. I have some employees working on it? Will these changes
    : affect them?
    : What type of precautions I need to take on the whole??
    : Thank You
    : Madhavan
    Oracle Technology Network
    http://technet.oracle.com
    null

  • Solution for error code: 4SNS/1/40000000/IBOR-9.426

    My computer recently has been running at its best. I did a diagnostic and gave me an error code 4SNS/1/40000000/IBOR-9.426. I wanted to get an idea what this means and what is the solution?

    That indicates an internal sensor failure.  You will have to take your MBP to an Apple store genius bar for repairs.
    Ciao.

  • Any better solution for this ?

    public static void main (String args [])
         for (int row = 1; row <= 5; row++)
              for (int col1 = 4; col1 >= row; col1--)
                   System.out.print(" ");
              for (int col2 = row*2; col2 > 1; col2--)
                   System.out.print("*");
              System.out.println();
         for (int row = 1; row <= 4; row++)
              for (int col1 = 1; col1 <= row; col1++)
                   System.out.print(" ");
              for (int col2 = 4; col2 >= row; col2--)
                   System.out.print("*");
              for (int col3 = row; col3 < 4; col3++)
                   System.out.print("*");
              System.out.println();
    }I'm trying to make this:
    I think that my solution is too long. any shorter solution?
    TQ

    It IS hardwired to produce that figure and only that figure.
    What if they asked you to redo it with fewer or more rows of stars?
    You did a "bad" thing: you hardwired your loop sizes. Something like "i <= 4" is called a "magic number", because someone reading your code would have no idea where the 4 came from.
    You also have 4 appear in several places. That violates the Don't Repeat Yourself rule. If you have to change it, and forget one of the spots, your code is wrong.
    You can help both situations by defining a well-named constant and using that for the loop upper limit:
    public class DiamondsAreAGirlsBestFriend
       public static final int DIAMOND_SIZE = 4;
       public static void main(String [] args)
          for (int row = 0; row <= DIAMOND_SIZE; ++row)
          // and so on
    }Also, better to put this into a method that would take in a diamond size value and return a String. Then it's general.
    None of this is very important for this trivial problem, but they might be worth remembering when you start writing more complex programs.
    %

  • Solution for Error Code 148:3

    So had this error and been looking around to see if I could find a solution on the forums or the support section and could not find a concrete answer. However I did read (here http://forums.adobe.com/message/1659492#1659492) something which reminded me of changes I had made to my boot sequence recently that I decided to check up on.
    I try to keep a lean system so I try and turn off services and programs from starting up when I dont need them.
    This problem for me has been cause by turning off the "FLEXnet Licensing Service" through msconfig. When it was turned back on and I rebooted problem solved.
    For those that are unsure if thats it and dont know what I am on about follow these instructions:
    (Warning: If you dont know what your doing with the book sequence or msconfig, follow the instructions and leave everything else alone. Using this tool can cause untold problems if you dont know what your doing and you dont closely follow instructions)
    1.- Press "Windows Key" + R on your keyboard or click the Start button (bottom left of screen)  and then select Run.
    2.- Type "msconfig" (without the quotes) and hit return.
    3.- System configuration window will come up, select the Services tab.
    4.- Select "Hide all Microsoft Services" and look for "FLEXnet Licensing Service".
    5.- Ensure "FLEXnet Licensing Service" is selected
    6.- Click Apply and then Close and choose to reboot your machine.
    7.- When Windows starts up again there should be a window telling you a change has been made, tick the box so it does not come up again and click ok.
    Your problem should be solved, I hope. Worked for me. I also tested it, any time I turn it off Dreamweaver stops working and when its turned back on its fine.
    Hope this helps
    Ethnod

    wow...wssparky  thanks a TON. I got the adobe error today and it was driving me INSANE. I *think* the problem had to do with my having to disable all my startup stuff in Windows7 to fix a problem I was having updating some other Microsoft software. Anyway MS said  disable everything using the msconfig and it was after that when Adobe stopped functioning (my McAfee is having an issue as well) properly.
    At any rate I got the adobe "fix" and it worked GREAT!
    I was NOT having any luck to begin with by going to the support area at adobe.com (HEY ADOBE PEOPLE>> TAKE NOTE)
    searching "support" for the error code tells me "Your search of Support for error 148:3 did not match any documents." which I find interesting
    so I finally googled the error code and found this thread.
    now a word to those who are less than kind in their posts and make people feel  stupid for asking the question here...I would submit these forums are for us (the users) to help each other (read: be nice to each other) so we can USE the software we OWN.
    I'm frankly disappointed that going to the Adobe "SUPPORT" was fruitless. MY problem was with the CS4 suite: I own the master collection which wasn't exactly cheap....it wold be nice if I, as a customer was able to at least FIND Adobe's OWN error code on their support section.
    again... thanks to wssparky

  • ODI Solutions for release code

    Hi Guys,
    Got few quries regarding ODI Solutions and how to use them.
    Once we finish our development can we used ODI Solutions to release the
    code(scenarios) into TEST/PROD and at the same time we also need to release whole code into hotfix environment(development work repository).
    The question is if there is an error in one of the interfaces we will fix the bug
    in the development environment and if we want to sync development with hotfix,how can we do that using ODI Solutions?
    do we need to build one more ODI Solution(whole project which includes the
    changed interface) and import that into HOTFIX environment?
    If it is yes,i have tried that but iam not getting that changed interface properly updated with the change?iam still having same old interface.any ideas? and how to appraoch this kind of scenario?
    Any idea about this?
    Cheers

    Hi,
    personally i dislike ODI Solution. Historically they had got so many issue to trust them once more..
    By the way, i face versioning duplicating the object and working on the copy. Remember that, if you restore a solution, any later development will be lost.
    Another way, suggested me by my personal Guru is to use solutions, create another repo (called EMERGENCY REPO) and restore solutions into this repo to fix it.

  • Better solution for Notes calendar synchronization...

    Hi,
    I have a 6233 with all the problems described in this forum when synchronizing repeating calendar invitations etc.
    This annoys me a lot .... I want to forget about Nokia PC Suite.
    Are there people who are using other products for Notes synchronization to 6233 or similar phones? Please share your experiences .....
    Thanks, Menno.

    Antonio Conte wrote:
    On My Mac, I went to iCloud in System Prefs, I entered my iTunes email and password, and let it do the rest itself, I didn't change anything else, I notied that Mail & Notes wasn't sync'd by default.
    What do you mean "let it do the rest itself"?  Did you browse to mobileme.com and go throught the process of upgrading from MobileMe to iCloud?

  • Is the "ActionScript 2.0 compiler" (mentioned in latest AIR 3.8 beta notes) for AS2 code?

    This page says:
    "ActionScript 2.0 Compiler: The Actionscript Compiler 2.0 has been incorporated into the AIR SDK 3.8 (named 'AIR SDK 3.8 & Compiler') and retired as a separate download from Adobe Labs on March 14, 2013."
    I'm working on an AIR Mobile project where we would probably be saved about 6 months of intensive work if some of our legacy AS2 code could be compiled and run in AIR Mobile for iOS. So if there is actually an "ActionScript 2.0 Compiler" in AIR SDK 3.8, that would be fantastic to hear.
    However I suspect that this note has nothing to do with actually "compiling ActionScript 2.0 code"; I suspect this simply refers to version 2.0 of the "ActionScript Compiler". (Which is of course the same as the old "Flex Compiler." Which of course had nothing to do with the "Flex framework".)
    Clarification would be appreciated!

    Thanks Apocalyptic0n3.
    Anton, I was not mixing definitions, Adobe was. AS2 is "ActionScript 2.0". Adobe made a page that says that the "ActionScript 2.0 Compiler" is now included in AIR 3.8. Hence my desire for clarification.

  • Better solution for Delivering messages

    Hello All,
    In our prod environment, We observe quite often, when ever there is an issue at target side ,messages are failing and status in NDLV state in Adapter Engine ,apart from this NDLV state ,we observe few messages in Delivering state.
    When the issue at target side get resolved.we are restarting NDLV (system error state ) messages from Adapter engine in RWB.
    In order to process the Delivering messages ,we are restarting the message system to make the delivering messages to NDLV state.then we reprocessing those messages.
    Because of this Messaging system restart  to resolve the issue ,few more messsages failing during that time.
    So for reprocessing the Delivering state message,Is there any possible way to handle this apart from restarting Messaging system.
    Please provide inputs on this
    Thanks and Regards,
    Vidya Sagar

    I dont think with out the restart of the java stack DLNG messages will get cleared off..
    options you can look for is possiblity of the target system maintenance schedule in advance and disable the particular channel
    which will not work for hard shutdowns of target systems..i.e immediate shutdown cases..
    Increase the no of threads for particular adapter queues..you can increase the thread count for the adapters based on the factors provided by the sap..which will not result in To be delivered messages..
    HTH
    Rajesh

  • Better solution for Photoshop CC update error U44M1P34

    How can I fix Photoshop CC update error U44M1P34 without uninstalling ALL OF MY ADOBE PRODUCTS !?

    Hello. I'm having the same problem to install the update Photoshop and Bridge.
    The error is U44M1P34 and I've done the procedure of uninstalling and reinstalling the Adobe applications. It did not work.
    I suspect that is because I use Windows 8 in Brazilian Portuguese, which makes the Program Files directory call up Arquivos de Programas. I suspect that the application of the CC does not recognize the name.
    Please, help me find a solution.
    Thanks

Maybe you are looking for