Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

47
LINES

< > BotCompany Repo | #1016474 // GMail Send Form [Type New GMail, Dyn Module, OK]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 715K of libraries. Click here for Pure Java version (8809L/63K).

1  
!7
2  
3  
sclass GMailSendForm extends DynModule {
4  
  SS data;
5  
  transient JComponent form;
6  
  transient JTextField tfSender, tfTo, tfSubject;
7  
  transient JTextArea tfText;
8  
  
9  
  bool warnOnDelete() { true; }
10  
  
11  
  visualize {
12  
    tfSender = jtextfield(completeGMailAddress(gmailDefaultUser()));
13  
    tfTo = jtextfield("billg@microsoft.com");
14  
    tfSubject = jtextfield("Hello");
15  
    tfText = jwrappedtextarea(trim(
16  
[[
17  
Hello Bill.
18  
  
19  
-Sent from my JavaX computer
20  
]]));
21  
22  
    form = setFormData(data, makeForm(
23  
      "From:", tfSender,
24  
      "To:", tfTo,
25  
      "Subject:", tfSubject,
26  
      "Text:", tfText,
27  
      "", jbutton("Send mail!", r-thread-messagebox {
28  
        infoBox("Sending...");
29  
        quickGMail(getTextTrim(tfSender), getTextTrim(tfTo),
30  
          getTextTrim(tfSubject), getText(tfText));
31  
        infoBox("Sent!");
32  
      })));
33  
    awtCalcEvery(form, 10.0, r saveData);
34  
    ret form;
35  
  }
36  
37  
  void saveData {
38  
    temp enter();
39  
    if (form != null)
40  
      setField(data := autoGetDataFromForm(form));
41  
  }
42  
  
43  
  void unvisualize {
44  
    saveData();
45  
    super.unvisualize();
46  
  }
47  
}

Author comment

Began life as a copy of #1014736

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1016474
Snippet name: GMail Send Form [Type New GMail, Dyn Module, OK]
Eternal ID of this version: #1016474/14
Text MD5: e8174bf08e42d4452da256125005ba25
Transpilation MD5: ddce1cf3350b7782713fcc538d5d39e9
Author: stefan
Category: javax / mail / gui
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-01-19 22:23:06
Source code size: 1120 bytes / 47 lines
Pitched / IR pitched: No / No
Views / Downloads: 375 / 1949
Version history: 13 change(s)
Referenced in: [show references]