☕ Java Pahelp po sa event handling

Status
Not open for further replies.

nirv47a

Honorary Poster
mga boss pahelp po sa event handling ng java swing. gusto ko po kasing gawin pagtapos ng pagkaclick ko ng OK using JDialog ay mag karoon uli ng Jdialog uli. kaya ko kasing gawin using jbutton pero not with jdialog. anyone who knows this? respect po thanks!
import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Build { public static void main(String[] args) { while (true) { String x = JOptionPane.showInputDialog(null, "Welcome!\n\n" + "Enter your name:\n"); if (x.isEmpty()) { JOptionPane.showMessageDialog(null, "Please input your name", "ERROR", JOptionPane.ERROR_MESSAGE); continue; } else { JOptionPane.showMessageDialog(null, "Welcome " + x, "Welcome!", JOptionPane.INFORMATION_MESSAGE); break; } } } }
 
[XX='nirv47a, c: 1283892, m: 1362070'][/XX] Kapag nag input yung user ng name ay lalabas po ito
1623478349196.webp
then may gusto ka po bang ilagay after lumabas yang pane?
 
Status
Not open for further replies.

Similar threads

About this Thread

  • 7
    Replies
  • 359
    Views
  • 2
    Participants
Last reply from:
Arcturus

Trending Topics

Online now

Members online
1,048
Guests online
1,515
Total visitors
2,563

Forum statistics

Threads
2,294,932
Posts
29,094,144
Members
1,206,613
Latest member
cheeseterrific
Back
Top