Popup Message boxes

后端 未结 8 1153
粉色の甜心
粉色の甜心 2020-12-04 16:33

I am unsure of how to code popup message box in my methods.

public String verify(){
    String result = \"failed\";
    int authcode = staffBean.getVerifyCod         


        
8条回答
  •  南方客
    南方客 (楼主)
    2020-12-04 16:38

    POP UP WINDOWS IN APPLET

    hi guys i was searching pop up windows in applet all over the internet but could not find answer for windows.

    Although it is simple i am just helping you. Hope you will like it as it is in simpliest form. here's the code :

    Filename: PopUpWindow.java for java file and we need html file too.

    For applet let us take its popup.html

    CODE:

    import java.awt.*;
    
    import java.applet.*;
    
    import java.awt.event.*;
    
    public class PopUpWindow extends Applet{
    
    public void init(){
    
    Button open = new Button("open window");
    
    add(open);
    
    Button close = new Button("close window");
    
    add(close);
    
     Frame f = new Frame("pupup win");
    
      f.setSize(200,200);
    
    
    
    
     open.addActionListener(new ActionListener() {
    
                     public void actionPerformed(ActionEvent e) {
                         if(!f.isShowing()) {
                             f.setVisible(true);
                         }
    
    
                     }
    
                  });
     close.addActionListener(new ActionListener() {
    
                     public void actionPerformed(ActionEvent e) {
                         if(f.isShowing()) {
                            f.setVisible(false);
                         }
    
                     }
    
                  });
    
     }
    
    }
    
    
    
    
    /*
    
    
    
    
    
    
    
    
    
    
    
    
    */
    
    
    to run:
    $javac PopUpWindow.java && appletviewer popup.html
    

提交回复
热议问题