home *** CD-ROM | disk | FTP | other *** search
Wrap
import java.awt.BorderLayout; import java.awt.Container; import java.awt.Event; import java.awt.Font; import java.awt.Label; import java.awt.Panel; import java.awt.TextArea; import java.awt.TextField; public class EmailMyFriend extends JDPClassLayout { JDPUser user; JDPJagg jaggSQL; JDPPopupMessage popuppanel; JDPMaskEdit JDPMaskEditMain; String moduleParameter; Panel Main; JDPEmailSender EMail1; JDPChiselFramePanel ChiselPanel1; Panel Panel1; JDPScrollPanel ScrollPanel2; Label Label6; Label Label7; Label Label8; Label Label9; TextField fromAddress; Label Label2; TextField toAddress; Label Label3; TextField firstName; Label Label1; TextArea messageText; JDPButtons JDPButtons1; Label Label4; TextField mailServer; public void InitClass(JDPUser var1, Panel var2, String var3) { this.user = var1; this.moduleParameter = var3; super.targetPanel = var2; 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.EMail1 = new JDPEmailSender(var1); this.ChiselPanel1 = new JDPChiselFramePanel(var1, "Tell a friend about JDesignerPro!"); this.Panel1 = new Panel(); this.ScrollPanel2 = new JDPScrollPanel(); this.Label6 = new Label("Simply enter the information below and", 0); this.Label7 = new Label("a message will be sent to your friend", 0); this.Label8 = new Label("telling them all about JDesignerPro.", 0); this.Label9 = new Label("Enter your email address:", 0); this.fromAddress = new TextField("", 30); this.Label2 = new Label("Your friend's email address:", 0); this.toAddress = new TextField("", 30); this.Label3 = new Label("Your friend's first name:", 0); this.firstName = new TextField("", 30); this.Label1 = new Label("Add a personal note:", 0); this.messageText = new TextArea("", 6, 31); String[] var4 = new String[]{"Send"}; int[] var5 = new int[]{JDPButton.getIconValue("Email")}; this.JDPButtons1 = new JDPButtons(var1, var4, var5, JDPButtons.getAlignmentValue("Horizontal")); this.Label4 = new Label("Enter your mailserver (only if send fails):", 0); this.mailServer = new TextField("mail", 30); this.Main.setLayout(new BorderLayout()); ((Container)this).add("Center", this.Main); this.Main.add("West", this.ChiselPanel1); this.ChiselPanel1.add("Center", this.Panel1); this.Panel1.setLayout(new BorderLayout()); this.Panel1.add("North", this.ScrollPanel2); this.ScrollPanel2.add("Left", this.Label6); this.ScrollPanel2.add("Left", this.Label7); this.ScrollPanel2.add("Left", this.Label8); this.ScrollPanel2.add("Left", this.Label9); this.ScrollPanel2.add("Left", this.fromAddress); this.ScrollPanel2.add("Left", this.Label2); this.ScrollPanel2.add("Left", this.toAddress); this.ScrollPanel2.add("Left", this.Label3); this.ScrollPanel2.add("Left", this.firstName); this.ScrollPanel2.add("Left", this.Label1); this.ScrollPanel2.add("Left", this.messageText); this.ScrollPanel2.add("Left", this.JDPButtons1); this.ScrollPanel2.add("Left", this.Label4); this.ScrollPanel2.add("Left", this.mailServer); this.Label6.setFont(new Font("Helvetica", 0, 11)); this.Label6.setForeground(var1.u._cvtcolor("Black")); this.Label6.setBackground(var1.u._cvtcolor("LightGray")); this.Label7.setFont(new Font("Helvetica", 0, 11)); this.Label7.setForeground(var1.u._cvtcolor("Black")); this.Label7.setBackground(var1.u._cvtcolor("LightGray")); this.Label8.setFont(new Font("Helvetica", 0, 11)); this.Label8.setForeground(var1.u._cvtcolor("Black")); this.Label8.setBackground(var1.u._cvtcolor("LightGray")); this.fromAddress.setFont(new Font("Helvetica", 0, 11)); this.fromAddress.setForeground(var1.u._cvtcolor("Black")); this.fromAddress.setBackground(var1.u._cvtcolor("White")); this.Label2.setFont(new Font("Helvetica", 0, 11)); this.Label2.setForeground(var1.u._cvtcolor("Black")); this.Label2.setBackground(var1.u._cvtcolor("LightGray")); this.toAddress.setFont(new Font("Helvetica", 0, 11)); this.toAddress.setForeground(var1.u._cvtcolor("Black")); this.toAddress.setBackground(var1.u._cvtcolor("White")); this.Label3.setFont(new Font("Helvetica", 0, 11)); this.Label3.setForeground(var1.u._cvtcolor("Black")); this.Label3.setBackground(var1.u._cvtcolor("LightGray")); this.firstName.setFont(new Font("Helvetica", 0, 11)); this.firstName.setForeground(var1.u._cvtcolor("Black")); this.firstName.setBackground(var1.u._cvtcolor("White")); this.Label1.setFont(new Font("Helvetica", 0, 11)); this.Label1.setForeground(var1.u._cvtcolor("Black")); this.Label1.setBackground(var1.u._cvtcolor("LightGray")); this.messageText.setFont(new Font("Helvetica", 0, 11)); this.messageText.setForeground(var1.u._cvtcolor("Black")); this.messageText.setBackground(var1.u._cvtcolor("White")); this.JDPButtons1.setFont(new Font("Helvetica", 0, 11)); this.JDPButtons1.setForeground(var1.u._cvtcolor("Black")); this.JDPButtons1.setBackground(var1.u._cvtcolor("LightGray")); this.Label4.setFont(new Font("Helvetica", 0, 11)); this.Label4.setForeground(var1.u._cvtcolor("Black")); this.Label4.setBackground(var1.u._cvtcolor("LightGray")); this.mailServer.setFont(new Font("Helvetica", 0, 11)); this.mailServer.setForeground(var1.u._cvtcolor("Black")); this.mailServer.setBackground(var1.u._cvtcolor("White")); var1.gParm.addElement(this); this.InitComponents(); } public boolean handleEvent(Event var1) { switch (var1.id) { case 401: if (var1.key == 9 && var1.modifiers != 1) { if (var1.target.equals(this.fromAddress)) { this.user.u.cursor(this.toAddress); } if (var1.target.equals(this.toAddress)) { this.user.u.cursor(this.firstName); } if (var1.target.equals(this.firstName)) { this.user.u.cursor(this.messageText); } if (var1.target.equals(this.messageText)) { this.user.u.cursor(this.mailServer); } if (var1.target.equals(this.mailServer)) { this.user.u.cursor(this.fromAddress); } } if (var1.key == 9 && var1.modifiers == 1) { if (var1.target.equals(this.fromAddress)) { this.user.u.cursor(this.mailServer); return true; } if (var1.target.equals(this.toAddress)) { this.user.u.cursor(this.fromAddress); return true; } if (var1.target.equals(this.firstName)) { this.user.u.cursor(this.toAddress); return true; } if (var1.target.equals(this.messageText)) { this.user.u.cursor(this.firstName); return true; } if (var1.target.equals(this.mailServer)) { this.user.u.cursor(this.messageText); return true; } } return false; case 503: case 504: case 505: this.popuppanel.postEvent(var1); return false; case 1001: if (var1.target.equals(this.JDPButtons1.button[0])) { this.EMail1.setMailServer(this.mailServer.getText()); this.EMail1.setToAddress(this.toAddress.getText()); this.EMail1.setMessageSubject("Check out this Java tool"); this.EMail1.setReturnAddress(this.fromAddress.getText()); String var2 = this.firstName.getText() + ",\n\nI started using JDesignerPro, a Java Rapid Application Development tool\nthat I thought you might be interested in. You should check it out at\nhttp://www.bulletproof.com/. There's a free trial download.\n\n"; this.EMail1.setMessage(var2 + this.messageText.getText()); this.EMail1.sendSingleMessage(); return true; } return false; default: return false; } } public void InitComponents() { } }