Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7798919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:08:29+00:00 2026-06-02T00:08:29+00:00

JOptionPane.showConfirmDialog(null, instructorEditorPanel, Edit Player JOptionPane, JOptionPane.OK_CANCEL_OPTION,JOptionPane.PLAIN_MESSAGE); instructorEditorPanel is a Jpanel with 3 textfields. I

  • 0
JOptionPane.showConfirmDialog(null, instructorEditorPanel,
              "Edit Player JOptionPane", JOptionPane.OK_CANCEL_OPTION,JOptionPane.PLAIN_MESSAGE);

instructorEditorPanel is a Jpanel with 3 textfields. I am trying to obtain the data in the textFields and assign them to instance variables within the parent class. I know how to get the data using the getText() method. My problem is rigging the handler to perform an action when the OK button is selected.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T00:08:31+00:00Added an answer on June 2, 2026 at 12:08 am

    In this case, the showConfirmDialog() will return 0 when click the OK button. You can do something like this:

    if(JOptionPane.showConfirmDialog(null, instructorEditorPanel, "Edit Player JOptionPane", OptionPane.OK_CANCEL_OPTION,JOptionPane.PLAIN_MESSAGE) == JOptionPane.OK_OPTION){
        //do something with value
        fieldOnPanel.getText();
    }
    

    Obviously, you need to have access to the JPanel or the JTextField instance.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

int r = JOptionPane.showOptionDialog(null, myPanel, Choose, JOptionPane.NO_OPTION, JOptionPane.PLAIN_MESSAGE, null, new String[]{}, // this is
I'm trying to put a JSpinner in a JOptionPane as follows, SpinnerModel saModel =
I am checking the below condion and displaying dialog box if(query.contains(tab)) { JOptionPane.showMessageDialog(null,Owner does
I would like to ask you how can I insert JPanel into JOptionPane and
int n ; n= (int)( javax.swing.JOptionPane.showInputDialog(null,enter a 3 digit no.)); Why does the above
I have a JOptionPane: JOptionPane.showMessageDialog(null, text); The text is a sting: String text =
I'm using JOptionPane.showMessageDialog(null,e,Invalid Name,JOptionPane.ERROR_MESSAGE) method to display the exception extended from Exception class. But
If I write this line in Java: JOptionPane.showInputDialog(null, Write something); Which method will be
I've created a JOptionPane and it only has two buttons YES_NO_OPTION . After JOptionPane.showConfirmDialog
I have a dialog box that is: JOptionPane.showMessageDialog(null,Once medicine is given, measure temperature within

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.