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

Trending Topics

Online now

Members online
1,160
Guests online
5,619
Total visitors
6,779

Forum statistics

Threads
2,354,500
Posts
29,383,900
Members
1,079,468
Latest member
bgzin99
Back
Top