₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,330,866 members, 8,447,472 topics. Date: Saturday, 18 July 2026 at 11:23 AM

Toggle theme

Java Gui Problem Solver - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingJava Gui Problem Solver (1159 Views)

1 Reply (Go Down)

Java Gui Problem Solver by Akprof(op): 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(op): 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(op): 3:31pm On Jun 21, 2015
Thanks my bro
1 Reply

How Do I Make My Java GUI Stuff Executable (like desktop shortcut)Stack Overflow Just Launched Real-world Developer Problem SolverJava Gui Gurus234

I'm In Need Of A Professional Webmaster/web Developer Service Within Abeokuta!!!Space For A C#/asp. Net Programmer On Our Development TeamCustom Wp Theme Needed