Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JDialog  RSS feed

 
Friend
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we insert a variable value in JOptionPane INFORMATION_MESSAGE dialog?
eg: count=1;
JOptionPane opt=new JOptionPane("+count",INFORMATION_MESSAGE);
Please.......
Thank you.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As long as the first parameter is an object you can.
int count = 1;
String message = "The count is " + count;
JOptionPane opt=new JOptionPane(message, INFORMATION_MESSAGE);
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!