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

JOptionPane in JavaFX Making Window 'Not Respond'

I am building a JavaFX app and am using JOptionPane to display dialogs One of the problems I've encountered is that creating a new dialog and not dismissing it within 5 or so seconds will cause the main JavaFX stage go into a 'Not Responding'…
SuperMrBlob
  • 611
  • 6
  • 19
0
votes
2 answers

Program giving wrong output

I need some help with my program here. Can anyone help me out with this? Thanks! Every time I run my code, I get the following output: But I want the output to be like this in one box instead of many: Code: public class myDesCbc2 { public…
Noob_Programmer
  • 111
  • 5
  • 14
0
votes
1 answer

JOptionPane input dialog menu

Looking for some help with my code here. I'm trying to create a JOptionPane input dialog that will take the input from the user (either option 1 or option 2) and display the next menu based on the first input. There will be a different outcome for 1…
Noob_Programmer
  • 111
  • 5
  • 14
0
votes
4 answers

Cant get JOptionPane string input to match a string value

I am relatively new to coding in general and have run into an issue, I've looked everywhere for help but I cant find this issue. It would be greatly appreciated if someone could tell me why the string "s" doesn't ever equal the string "temp" even if…
0
votes
1 answer

Dialog box buttons aren't shown in JOptionPane.showConfirmDialog

I have the following Dialog box in my application. I use a JPanel to show the following components in the dialogbox but I see that the confirm buttons aren't shown well. I'd prefer to solve the problem with default dialog boxes. Is it possible to…
Johnny
  • 1,509
  • 5
  • 25
  • 38
0
votes
1 answer

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException Java

I keep getting this error in my console, however there's no error in my coding when I look over it. It also keeps opening up the exact same JOptionPanes when I don't want it to open up. After the loops supposedly finish, the JOptionPane reopens and…
user3092008
  • 19
  • 1
  • 1
  • 5
0
votes
1 answer

Read input from a JOptionPane.showInputDialog box

I am almost done with this project. It's my very first one and I need to read a little better the inputs from the JOption box. For example, I want to go back to the previous page if the user clicks on "cancel" or close the program. So far, every…
user3150308
  • 1
  • 1
  • 1
0
votes
1 answer

How to fix a JOptionPane that spams messages?

so I created this program and it was working perfectly fine before, however after transferring computers, my program is exploding. The JOptionPane is being spammed and completely running ram pate. If you could please run this program and tell me…
user3092008
  • 19
  • 1
  • 1
  • 5
0
votes
1 answer

JOptionPane Dialog Box Error

I'm getting this error message: The method showMessageDialog(Component, Object, String, int, Icon) in the type JOptionPane is not applicable for the arguments (JFrame, String, String, int, int, ImageIcon, String) When I hover over…
Anon
  • 141
  • 1
  • 11
0
votes
1 answer

Controlling the font size and background colour when printing jeditorpane

I want to print out the contents of a JEditorPane, which contains highlighted text (the colour is set using setCharacterAttributes). However, when I use the most basic print() method, as in: try { boolean complete = TextArea.print(); if…
0
votes
1 answer

Error on .showMessageDialog in my JPanel?

I'm creating a Combination/permutation calculator. I'm in the process of making the GUI, and just tried making the public Combination() and put the formulas inside. Here's a snippet of code public long Combination() { String ncString =…
0
votes
2 answers

showInputDialog freezes other windows

Im using several showInputDialogs in a program. When one of these input pops up it freezes all the other windows in the background until it has recieved an input, is there a way to make it not freeze the other windows?
Looptech
  • 213
  • 2
  • 4
  • 12
0
votes
2 answers

JOptionPane input problems

Ok, so I understand that if you want to test what the user clicks in a JOptionPane, you would do something like this: final int option = JOptionPane.showConfirmDialog(null, "That file name does not exist.", "File Name",…
NathanWick
  • 87
  • 1
  • 10
0
votes
3 answers

JDialog does not display proper text

I'm creating an About dialog for my program and have run into an issue. Whenever I launch the dialog, the title text sets properly, but the text inside the dialog says "JOptionPane Message". Before it wouldn't even show the label I added to the…
Thomas Ramage
  • 73
  • 1
  • 9
0
votes
1 answer

Using Bubble Sort with JOptionPanes

I want to bubble sort an array that could be any number with values from the user. But the first method is not working. I really want to use JOptionPanes, but I don't even know if that is the problem. It compiles correctly, but doesn't run properly.…
user2877117
1 2 3
99
100