⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 yorndia.java

📁 JTREE的例子
💻 JAVA
字号:
package util5;import java.awt.*;import java.awt.event.*;import javax.swing.*;import util2.*;import util3.*;import util4.*;public class YorNDia extends JDialog{  JLabel lab=new JLabel("");  JPanel pan=new JPanel(new BorderLayout(10,10));  JButton okBut=new JButton("Yes");  JButton noBut=new JButton("No");  YorNListener listener;  public YorNDia(Frame frame,String title,boolean modal){    super(frame,title,modal);    JPanel p=new JPanel(new FlowLayout(2,20,12));    p.add(this.okBut);    p.add(this.noBut);    this.getContentPane().add(pan,BorderLayout.CENTER);    this.getContentPane().add(new JLabel("   "),BorderLayout.WEST);    pan.add(this.lab,BorderLayout.CENTER);    pan.add(p,BorderLayout.SOUTH);    setBounds(200,180,400,140);    okBut.addActionListener(new ActionListener(){      public void actionPerformed(ActionEvent e){        YorNDia.this.listener.gotYes(YorNListener.yes);        YorNDia.this.listener=null;        YorNDia.this.setVisible(false);      }    });    noBut.addActionListener(new ActionListener(){      public void actionPerformed(ActionEvent e){        YorNDia.this.setVisible(false);        YorNDia.this.listener.gotYes(YorNListener.no);      }    });    this.addWindowListener(new WindowAdapter(){      public void windowClosing(WindowEvent e) {        YorNDia.this.listener.gotYes(YorNListener.cancel);        YorNDia.this.listener=null;        YorNDia.this.setVisible(false);      }    });  }  public void setLab(String text){    this.lab.setText(text);  }  public void addYorNListener(YorNListener listener){    this.listener=listener;    this.show();  }  public static void main(String art[]){    Frame f=new Frame("");    YorNDia d=new YorNDia(f,"",false);    d.show();  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -