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).

!7

sclass GMailSendForm extends DynModule {
  SS data;
  transient JComponent form;
  transient JTextField tfSender, tfTo, tfSubject;
  transient JTextArea tfText;
  
  bool warnOnDelete() { true; }
  
  visualize {
    tfSender = jtextfield(completeGMailAddress(gmailDefaultUser()));
    tfTo = jtextfield("billg@microsoft.com");
    tfSubject = jtextfield("Hello");
    tfText = jwrappedtextarea(trim(
[[
Hello Bill.
  
-Sent from my JavaX computer
]]));

    form = setFormData(data, makeForm(
      "From:", tfSender,
      "To:", tfTo,
      "Subject:", tfSubject,
      "Text:", tfText,
      "", jbutton("Send mail!", r-thread-messagebox {
        infoBox("Sending...");
        quickGMail(getTextTrim(tfSender), getTextTrim(tfTo),
          getTextTrim(tfSubject), getText(tfText));
        infoBox("Sent!");
      })));
    awtCalcEvery(form, 10.0, r saveData);
    ret form;
  }

  void saveData {
    temp enter();
    if (form != null)
      setField(data := autoGetDataFromForm(form));
  }
  
  void unvisualize {
    saveData();
    super.unvisualize();
  }
}

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: 373 / 1945
Version history: 13 change(s)
Referenced in: [show references]