• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDialog

 
Randall Twede
Ranch Hand
Posts: 4467
3
Java Python 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: 4467
3
Java Python 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