aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JDialog Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JDialog" Watch "JDialog" New topic
Author

JDialog

Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

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


SCJP
Visit my download page
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

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.

 
Don't get me started about those stupid light bulbs.
 
subject: JDialog