Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Conversation Between speedmaster and javapenguin

2 Visitor Messages

  1. Also, I may be able to find a way to revamp JOptionPane for your choices to show a request to the user to choose and option and 3 buttons on the JOptionPane, I'll have to change around the layout of the YES_NO_CANCEL_OPTION layout, but it can be done.

    JFrame frame = new JFrame();

    Object[] options = {"1: Withdraw", "2: Deposit", "3: Show Balance"};
    int n = JOptionPane.showOptionDialog(frame,
    "Choose a 1,2, or 3.",
    "Choose an option",
    JOptionPane.YES_NO_CANCEL_OPTION,
    JOptionPane.INFORMATION_MESSAGE,
    null,
    options,
    options[0]);
    if (n == YES_OPTION)
    {
    // option 1
    }

    else if (n == NO_OPTION)
    {
    // option 2
    }

    else if (n == CANCEL_OPTION)
    {
    // option 3
    }
  2. I think I've got it, though I'll attempt a revamping in the morning.
Showing Visitor Messages 1 to 2 of 2