Slow performance of javax.swing.JOptionPane.showOptionDialog
-
Hi, I'm using javax.swing.JOptionPane.showOptionDialog for getting user input. But this is very slow. Please can someone let me know how to improve the functionality of this? or is there any alternative to speed up. It's so disappointing as this takes seconds to load a simple user input window. Below is the code I have used for this, JOptionPane.showOptionDialog( VolChangeMDIFrame.getDesktop(),VolUserInput,VolumeSelectTitle, JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null,null,null); Thanx in advance.
-
Hi, I'm using javax.swing.JOptionPane.showOptionDialog for getting user input. But this is very slow. Please can someone let me know how to improve the functionality of this? or is there any alternative to speed up. It's so disappointing as this takes seconds to load a simple user input window. Below is the code I have used for this, JOptionPane.showOptionDialog( VolChangeMDIFrame.getDesktop(),VolUserInput,VolumeSelectTitle, JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null,null,null); Thanx in advance.
The
javax.swing.JOptionPane.showOptionDialog
is not slow. I would be suspicious of one of the first three parameters. What is the parent objectVolChangeMDIFrame.getDesktop()
? Why not just usethis
?
Panic, Chaos, Destruction. My work here is done.
-
The
javax.swing.JOptionPane.showOptionDialog
is not slow. I would be suspicious of one of the first three parameters. What is the parent objectVolChangeMDIFrame.getDesktop()
? Why not just usethis
?
Panic, Chaos, Destruction. My work here is done.
Thx, the problem was incorrectly tracked by profiler. It's not a problem with javax.swing.JOptionPane.showOptionDialog ... :)
-
Thx, the problem was incorrectly tracked by profiler. It's not a problem with javax.swing.JOptionPane.showOptionDialog ... :)
I am having a very long delay with both the presentation of hte JOptionPane.showInputDialogue and when I click on the OK button, I get a 3-6 second delay. Here is the code: viewer.setStatus("Waiting on input"); String reason = JOptionPane.showInputDialog("Redaction Reason", "User"); if( reason != null && reason.length() > 0 ) { viewer.setStatus("Analyzing"); ..... do some analysis } Now, the status shows in the parent "viewer" and then a long wait ( sometimes ) until the option pane appears. Then a long wait while the components are painted, wait for the input field, wait for the OK button, and the Cancel button. Enter input, then click OK. VERY LONG WAIT ( 3-6 seconds ) before panel hides and next statement is executed. No indication of problem. CPU useage very low. Nothing else running to eat up cpu ( highest < 10% ) This seems to have appeared recently. Don't know if it was the upgrade in Java for Snow Leopard, or something I've done in the code, but I don't see why anything I've done that isn't eating up time would affect the time to appear or time to dissappear significantly. Running on Mac OS X Snow Leopard 10.6.3
-
I am having a very long delay with both the presentation of hte JOptionPane.showInputDialogue and when I click on the OK button, I get a 3-6 second delay. Here is the code: viewer.setStatus("Waiting on input"); String reason = JOptionPane.showInputDialog("Redaction Reason", "User"); if( reason != null && reason.length() > 0 ) { viewer.setStatus("Analyzing"); ..... do some analysis } Now, the status shows in the parent "viewer" and then a long wait ( sometimes ) until the option pane appears. Then a long wait while the components are painted, wait for the input field, wait for the OK button, and the Cancel button. Enter input, then click OK. VERY LONG WAIT ( 3-6 seconds ) before panel hides and next statement is executed. No indication of problem. CPU useage very low. Nothing else running to eat up cpu ( highest < 10% ) This seems to have appeared recently. Don't know if it was the upgrade in Java for Snow Leopard, or something I've done in the code, but I don't see why anything I've done that isn't eating up time would affect the time to appear or time to dissappear significantly. Running on Mac OS X Snow Leopard 10.6.3
-
In addition, all mouse events seem to be extremely slow with long delays in dragging, clicking, etc. It isn't the time for my code to process the event, it appears to be a delay before my code gets the event.