home *** CD-ROM | disk | FTP | other *** search
- import java.awt.BorderLayout;
- import java.awt.Button;
- import java.awt.Container;
- import java.awt.Event;
- import java.awt.Font;
- import java.awt.Panel;
-
- public class MessageBoxExample2 extends JDPClassLayout {
- JDPUser user;
- JDPJagg jaggSQL;
- JDPPopupMessage popuppanel;
- JDPMaskEdit JDPMaskEditMain;
- String moduleParameter;
- Panel Main;
- JDPScrollPanel ScrollPanel2;
- Button Button2;
- JDPMessageDialog MessageBox1;
-
- public void InitClass(JDPUser var1, Panel var2, String var3) {
- this.user = var1;
- this.moduleParameter = var3;
- this.jaggSQL = new JDPJagg(var1.jaggPath);
- ((Container)this).setLayout(new BorderLayout());
- this.popuppanel = new JDPPopupMessage(var1, this);
- ((Container)this).add(this.popuppanel);
- this.JDPMaskEditMain = new JDPMaskEdit();
- this.Main = new Panel();
- this.ScrollPanel2 = new JDPScrollPanel();
- this.Button2 = new Button("Press to display the message box");
- this.MessageBox1 = new JDPMessageDialog(var1, this);
- this.Main.setLayout(new BorderLayout());
- ((Container)this).add("Center", this.Main);
- this.Main.add("West", this.ScrollPanel2);
- this.ScrollPanel2.add("Left", this.Button2);
- this.Button2.setFont(new Font("Helvetica", 0, 11));
- this.Button2.setForeground(var1.u._cvtcolor("Black"));
- this.Button2.setBackground(var1.u._cvtcolor("LightGray"));
- this.MessageBox1.setFont(new Font("Helvetica", 0, 11));
- this.MessageBox1.setForeground(var1.u._cvtcolor("Black"));
- this.MessageBox1.setBackground(var1.u._cvtcolor("LightGray"));
- this.MessageBox1.setTitle("This is the message box title");
- this.MessageBox1.setMessage("This is the message box text|with two lines|and this is line 3");
- this.MessageBox1.setButtonCount(2);
- this.InitComponents();
- var1.gParm.addElement(this);
- }
-
- public boolean handleEvent(Event var1) {
- switch (var1.id) {
- case 503:
- case 504:
- case 505:
- this.popuppanel.postEvent(var1);
- return false;
- case 1001:
- if (var1.target.equals(this.Button2)) {
- this.MessageBox1.display();
- this.user.mainmsg.setStatusMsg("Button " + Integer.toString(this.MessageBox1.getPressedButton()) + " was pressed", 8);
- return true;
- }
-
- return false;
- default:
- return false;
- }
- }
-
- public void InitComponents() {
- this.MessageBox1.setButtonText(0, "Yes");
- this.MessageBox1.setButtonText(1, "No");
- }
- }
-