This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JDialog  RSS feed

 
Randall Twede
Ranch Hand
Posts: 4690
8
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this should be fairly simple but i am having difficulty. here is some code.

i want the fadeMenuItem to display a dialog very much like the strokeMenuItem does only with a slider instead of a textfield. i looked at the tutorial for custom dialog but it only confuses me. what exactly do i have to do? it seems i have to declare a JDialog and then add a JOptionPane to it?

i also face another problem. when the slider moves i want either the main image to change, or i want a small preview image in the dialog.

any help appreciated
 
Randall Twede
Ranch Hand
Posts: 4690
8
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i found a simpler example of extending JDialog. even better, i found this:

If you don't need much in the way of custom behavior, JOptionPane is a good time saver. It takes care of the placement and localization of OK / Cancel options, and is a quick-and-dirty way to show a custom dialog without needing to define your own classes. Most of the time the "message" parameter in JOptionPane is a String, but you can pass in a JComponent or array of JComponents as well.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!