☕ 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
  • 366
    Views
  • 2
    Participants
Last reply from:
Arcturus

Trending Topics

Online now

Members online
1,076
Guests online
6,628
Total visitors
7,704

Forum statistics

Threads
2,329,852
Posts
29,250,441
Members
1,154,667
Latest member
rvegbetvegv
Back
Top