☕ 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; } } } }
 
Ganito po ba dapat ang lalabas if si user ay walang nilagay na input?
1623472838261.png
 
[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
  • 344
    Views
  • 2
    Participants
Last reply from:
Arcturus

Trending Topics

Online now

Members online
338
Guests online
620
Total visitors
958

Forum statistics

Threads
2,274,598
Posts
28,957,121
Members
1,234,339
Latest member
Madimetja
Back
Top