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

34
LINES

< > BotCompany Repo | #1014736 // GMail Send Form, with data retention (OK)

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Uses 4539K of libraries. Click here for Pure Java version (8732L/64K).

!7

static JComponent form;
static SS data;

p-noconsole {
  load("data");
  
  final JTextField tfSender = jtextfield(completeGMailAddress(gmailDefaultUser()));
  final JTextField tfTo = jtextfield("billg@microsoft.com");
  final JTextField tfSubject = jtextfield("Hello");
  final JTextArea tfText = jwrappedtextarea(trim([[
Hello Bill.

-Sent from my JavaX computer]]));

  form = setFormData(data, showFormTitled2("GMail Send Form",
    "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!");
    })));
    
  addFontChangersToTitleMenu(form, r innerCleanUpAndReRunMain);
}

svoid cleanMeUp {
  if (form != null) setAndSave(data := autoGetDataFromForm(form));
}

Author comment

Began life as a copy of #1014720

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1014736
Snippet name: GMail Send Form, with data retention (OK)
Eternal ID of this version: #1014736/11
Text MD5: 8a3bb997e26010e64a7eef2048f378cc
Transpilation MD5: a182b4f2dd1f21744acd8872bb0d9701
Author: stefan
Category: javax / mail / gui
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-19 17:21:53
Source code size: 940 bytes / 34 lines
Pitched / IR pitched: No / No
Views / Downloads: 499 / 1237
Version history: 10 change(s)
Referenced in: [show references]