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

18
LINES

< > BotCompany Repo | #1001529 // addSaveButton

JavaX fragment (include)

static void addSaveButton(final Component c, final S snippetTitle, O data) {
  final S string = structureOrText(data);
  awt {
    JButton btn = new JButton("Save...");
    btn.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        thread {
          S comment = slte("Comment for upload?");
          if (comment != null) {
            ntUpload("save-" + getProgramID(), snippetTitle, string, comment);
            print("Saved!");
          }
        }
      }
    });
    addToWindow(c, btn);
  }
}

Author comment

Began life as a copy of #1001527

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1001529
Snippet name: addSaveButton
Eternal ID of this version: #1001529/1
Text MD5: cc47a245df0404062833a69c3977c0b2
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-10-22 18:06:44
Source code size: 563 bytes / 18 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 709 / 905
Referenced in: [show references]