Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JOptionPane not working  RSS feed

 
Monica Salvador
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My program works fine until the JOptionPane is called. The title appears, but the content doesn't. Here's my code:



Can anybody help me?
Capture.PNG
[Thumbnail for Capture.PNG]
This is what happens.
 
Chiranjeevi Kanthraj
Ranch Hand
Posts: 290
Hibernate Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you post complete code..
 
Monica Salvador
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


it's thru rmi.. so it passes thru different classes. basically, i have the server pass the message to the client callback and then the callback passes it to the control and then to the view.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Can you test it with and tell us what happens?
 
Monica Salvador
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. Uhm the first picture happens.. But when I remove it from the method that the callback calls, it works. It shows the messagebox how it should be.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can try showing the dialog from the notifyMe() .
If that still doesn't work, you can post an SSCCE code. Please do take out time to find out what SSCCE really means by clicking on the link.
 
Rob Spoor
Sheriff
Posts: 21090
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From which thread is notifyMe called? You should only perform updates to the user interface from the Event Dispatcher Thread (EDT). You can use EventQueue.invokeLater or EventQueue.invokeAndWait* if needed.


* SwingUtilities.invokeLater and SwingUtilities.invokeAndWait merely redirect to EventQueue.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!