Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,713 members, 7,820,493 topics. Date: Tuesday, 07 May 2024 at 03:52 PM

Java Gui Problem Solver - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Java Gui Problem Solver (963 Views)

How Do I Make My Java GUI Stuff Executable (like desktop shortcut) / Stack Overflow Just Launched Real-world Developer Problem Solver / Java Gui Gurus (2) (3) (4)

(1) (Reply) (Go Down)

Java Gui Problem Solver by Akprof(m): 4:48pm On Jun 20, 2015
Hi my fellow Programmer/Nairalander, pls I need an assistance on to use the confirm dialog. YES or NO (i`e JOptionPane.showComfirmDialog(.........). Thanks a lot ).
Re: Java Gui Problem Solver by FincoApps(m): 7:19pm On Jun 20, 2015
What exactly do you need, how to get what the person clicked on ?
Akprof:
Hi my fellow Programmer/Nairalander, pls I need an assistance on to use the confirm dialog. YES or NO (i`e JOptionPane.showComfirmDialog(.........). Thanks a lot ).
Re: Java Gui Problem Solver by Akprof(m): 9:00pm On Jun 20, 2015
Exactly, pls can u help out?
Re: Java Gui Problem Solver by FincoApps(m): 9:12pm On Jun 20, 2015
Akprof:
Exactly, pls can u help out?

The showConfirmDialog returns an integer so you assign the method to an int variable. Then you can check by checking the value of the int variable. JOptionPane class has some fields you can use to check the exact button that was clicked. See an example:


int ans = JOptionPane.showConfirmDialog(null, "Confirm"wink;
if(ans == JOptionPane.YES_OPTION)
{
System.out.print("Yeeeeeeeeeeeea"wink;
}
else
{
System.out.print("HELL NO"wink;
}


Replace the annoying smiley face with a closing bracket
Re: Java Gui Problem Solver by Akprof(m): 3:31pm On Jun 21, 2015
Thanks my bro

1 Like

(1) (Reply)

Please, Programmers In The House I Need C++ Compiler / I Need Enlightening From Experts / Experienced Programming Opportunities Available Abroad!!!

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 9
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.