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

18
LINES

< > BotCompany Repo | #1001529 // addSaveButton

JavaX fragment (include)

1  
static void addSaveButton(final Component c, final S snippetTitle, O data) {
2  
  final S string = structureOrText(data);
3  
  awt {
4  
    JButton btn = new JButton("Save...");
5  
    btn.addActionListener(new ActionListener() {
6  
      public void actionPerformed(ActionEvent e) {
7  
        thread {
8  
          S comment = slte("Comment for upload?");
9  
          if (comment != null) {
10  
            ntUpload("save-" + getProgramID(), snippetTitle, string, comment);
11  
            print("Saved!");
12  
          }
13  
        }
14  
      }
15  
    });
16  
    addToWindow(c, btn);
17  
  }
18  
}

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: 645 / 838
Referenced in: [show references]