This week's giveaways are in the MongoDB and Jobs Discussion forums.
We're giving away four copies of Mongo DB Applied Patterns and 4 resume reviews from Five Year Itch and have the authors/reps on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes JDialog Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "JDialog" Watch "JDialog" New topic
Author

JDialog

Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4089
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
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4089
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.

 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: JDialog
 
Similar Threads
Icon for the title frame of the JDialog
Passing key strokes between objects
joptionpane problems
Passing key strokes between objects
JOptionPane