Questions tagged [joptionpane]

JOptionPane is a Java class that makes it easy to pop up a standard dialog box that prompts users for a value or informs them of something.

JOptionPane makes it easy to pop up a standard dialog box that prompts users for a value or informs them of something. For information about using JOptionPane, see How to Make Dialogs, a section in The Java Tutorial. Related examples may be found here.

1895 questions
0
votes
2 answers

ImageIcon Help + Close a JOptionPane

I'm trying to get the PayPal logo come up when you click the 'rightbutton' is clicked. Unfortunately, all that shows is the default Java logo with the cup of coffee and a pen. Also, how can I make it so once you click "OK" or "Cancel" it closes the…
user3377462
  • 13
  • 1
  • 4
0
votes
1 answer

ImageIcon + Closing on Clicking a JOptionPane

I'm trying to get the PayPal logo come up when you click the 'rightbutton' is clicked. Unfortunately, all that shows is the default Java logo with the cup of coffee and a pen. Also, how can I make it so once you click "OK" or "Cancel" it closes the…
user3377462
  • 13
  • 1
  • 4
0
votes
1 answer

Java Swing - Make a window like JOptionPane

I've been creating GUIs using Jigloo for a game and I've run into a problem. I would like one of my GUIs to have some properties that the JOptionPane has but I don't know how to describe it properly. The JOptionPane, when open, doesn't allow a…
Jared
  • 33
  • 1
  • 8
0
votes
0 answers

Restricting JOption input to A, B, C, or D

Having a hard time understanding why this code won't run as I'm hoping it should. I'm creating a test-checker with 2 arrays, one being a key and the other the user's inputs. I'm stuck trying to verify that the user will be restricted to ONLY…
0
votes
0 answers

How to display choices to the user for them to pick

So my code is supposed to display a dialog box that has choices on it and the user is supposed to choose. Whichever the user chooses, it will display a certain portion of a file as an array, which then sparks another choice for the user out of that…
0
votes
1 answer

Need help calling method to class

I can't figure out how to call this class and make it execute. I am calling methods from other classes to make a menu to take it to different related tasks as lesson on Mexico, but I can't figure out how to make it display this class. in the…
0
votes
2 answers

How do i call this Applet in this program?

I am using JOptionPane to make a menu that calls and executes program separately (the applet and menu are not required, i'm just doing it to make it better). I tried to call the init() method but it says "non-static method init() cannot be…
0
votes
1 answer

Close Input Message Dialog

Im new editating JOptionPane buttons so i have & JOptionPane.showInputDialog that needs to be closed when i click cancel button, the issue is that i've a Exception that shows Error creating the file if i click it, i just need the…
man
  • 35
  • 9
0
votes
1 answer

Check if JOptionPane input is correct

i want to make a JTable which should be used like a adressbook. so there is a button which is used to create new entrys. I want to create these entrys by using JOptionPane InpuDialog because I want that only Entrys with at least name and age are…
Jaran
  • 212
  • 2
  • 10
0
votes
3 answers

Accessing Strings in other methods created by JOptionPane?

I'm trying to use a string created by JOptionPane in another JOptionPane. I tried making the string global. Am I doing this correctly? import javax.swing.JOptionPane; public class Dialogue { public static String reason = ""; public static…
Tristan
  • 7
  • 4
0
votes
4 answers

User input and arrays

So I can't get this little snipit of code to work and I'm not sure why it wont... String rawInput = JOptionPane.showInputDialog("Please enter the three side lengths seperated by spaces."); double[] hold = double.parseDouble(rawInput.split(" ")); I…
lukeb28
  • 179
  • 1
  • 2
  • 12
0
votes
2 answers

JOptionPane.showInternalMessageDialog causing a runtime error

I am trying to have a box appear with the input of the velocity and angle, as well as showing the number of times the ball has been fired. It is giving me a runtime error and I'm not sure why. The piece that is causing the error is…
user3308067
  • 59
  • 1
  • 7
0
votes
2 answers

Putting a Option Pane in a String Variable

Okay I am not sure if this is the right web page to ask my question. I am new to learning Java, do not know any programming languages. I am teaching myself in order to write a specific program. So if this is not the place for BASIC question then…
0
votes
2 answers

Can't get a Message Dialog box to come from an Action Listener

I'm trying to output a message dialog box as a result of an Action Listener in my program. I keep receiving an error that says 'Uncompilable source code - incompatible types: void cannot be converted to java.lang.String'. I can't figure out what I'm…
0
votes
1 answer

JOptionPane Drop Down Menu Java

I'm trying to make a drop down menu using JOptionPane. The options I want it to have are the elements of an array list. So what i have done is create an array with elements of the array list. I want the user to be able to see the elements as…
user655321
  • 143
  • 4
  • 18