Results 1 to 14 of 14
Thread: Confirm Dialog box ?
- 06-08-2011, 08:39 PM #1
Member
- Join Date
- Jan 2011
- Posts
- 23
- Rep Power
- 0
Confirm Dialog box ?
Hey ! I have a program where I want to ask the user if he wants to delete his account..for that I want to use a confirm dialog box, but I'm not exactly sure how I should handle the options...something like if yes is pressed do that, if no is pressed do that .
But how exactly do I verify if yes or no is pressed ?Java Code:int no = JOptionPane.NO_OPTION; int yes = JOptionPane.YES_OPTION; JOptionPane.showConfirmDialog(null, "Do you really want to delete your account ?");
- 06-08-2011, 08:48 PM #2
Did you read the API? Check out the value returned from that method.
Recommended reading: How to Make Dialogs (The Java Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 06-09-2011, 04:26 PM #3
Member
- Join Date
- Jan 2011
- Posts
- 23
- Rep Power
- 0
- 06-09-2011, 04:40 PM #4
Member
- Join Date
- Apr 2011
- Posts
- 69
- Rep Power
- 0
try int response = JOptionPane.showConfirmDialog(null, "Do you really want to delete your account ?");
if (response == JOptionPane.YES_OPTION)
{
- 06-09-2011, 04:41 PM #5
Member
- Join Date
- Apr 2011
- Posts
- 69
- Rep Power
- 0
woops i hit the wrong button and it cut my post, but still you get the idea :D
- 06-10-2011, 12:15 AM #6
Member
- Join Date
- Jan 2011
- Posts
- 23
- Rep Power
- 0
hehe yes:D...very helpfull, thank you !
- 06-10-2011, 05:27 AM #7
'd3n1s', stop spoonfeeding and thus depriving others of a learning opportunity. Thanks.
dn
- 06-10-2011, 11:11 AM #8
Member
- Join Date
- Apr 2011
- Posts
- 69
- Rep Power
- 0
dude he was almost there, might as well complete it...
- 06-10-2011, 12:28 PM #9
Member
- Join Date
- Jan 2011
- Posts
- 23
- Rep Power
- 0
I don't think posting always the links of those tutorials is a better help....I always go through them and I can't understand a thing...(it's just my opinion but they are really bad - I never found something useful)....if you have never done this kind of things, how can you learn them? He showed me the code, so that next time I know how it's done....so thanks again 'd3n1s'....maybe it's not right to ask for the code, but at least if you know the answer and want to help me, you could give me some little hints (again, not those links)...
- 06-10-2011, 03:46 PM #10
Member
- Join Date
- Apr 2011
- Posts
- 69
- Rep Power
- 0
He read the tutorial, he did his homework. Sometimes you just need to see an example of it plugged into a working program to fully understand it.
- 06-10-2011, 07:18 PM #11
Are you even aware how much sample code is present and linked from those tutorials?
db
- 06-10-2011, 07:33 PM #12
Member
- Join Date
- Apr 2011
- Posts
- 69
- Rep Power
- 0
- 06-11-2011, 12:59 PM #13
Member
- Join Date
- Jan 2011
- Posts
- 23
- Rep Power
- 0
sorry 'd3n1s' for getting you into trouble....and mr. DarrylBurke, while the code might be simple to you, it isn't that simple to me...I bet you've got tons of experience, but I ain't yet...I wonder if you, in your first java programming years, could understand all that without any help at all.
- 06-11-2011, 01:56 PM #14
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,400
- Blog Entries
- 7
- Rep Power
- 17
When I started programming there was no internet; I had to study books and learn from them (and the cryptic mumbling of my professors). It forced me to read and I can say that it pays back: I can manage to find and understand stuff on my own. If you're spoonfed you don't really learn and it makes you lazy; but I guess that's what it's all about with the 'google generation': they want instant response without putting in any effort themselves.
kind regards,
Jos (<--- dinosaur)When people rob a bank they get a penalty; when banks rob people they get a bonus.
Similar Threads
-
Confirm dialog+pass parameters
By barcelonax in forum JavaServer Faces (JSF)Replies: 0Last Post: 12-21-2010, 08:20 AM -
dialog box
By blindfolded916 in forum New To JavaReplies: 5Last Post: 07-10-2010, 11:44 PM -
show Confirm Perspective Switch dialog box
By mostafa in forum EclipseReplies: 0Last Post: 11-22-2008, 11:47 AM -
Yes/No confirm dialog box
By mandrake446 in forum Advanced JavaReplies: 2Last Post: 12-09-2007, 05:31 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks