Skip to content

Commit 186fde1

Browse files
hansonrhansonr
authored andcommitted
SwingJS-site.zip for Clipboard reading
1 parent 4a843bd commit 186fde1

File tree

7 files changed

+8
-6
lines changed

7 files changed

+8
-6
lines changed
-80 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20200811045955
1+
20200813222737
-80 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20200811045955
1+
20200813222737
-80 Bytes
Binary file not shown.

sources/net.sf.j2s.java.core/src/test/TApp2.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public void keyTyped(KeyEvent e) {
153153

154154
@Override
155155
public void keyPressed(KeyEvent e) {
156-
System.out.println("keypressed");
156+
System.out.println("keypressed " + e);
157157
}
158158

159159
@Override

sources/net.sf.j2s.java.core/src/test/Test_Clipboard.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import javax.swing.TransferHandler;
2727
import javax.swing.table.DefaultTableModel;
2828

29+
import swingjs.JSUtil;
2930
import swingjs.plaf.JSTableUI;
3031

3132
public class Test_Clipboard extends JFrame {
@@ -163,9 +164,10 @@ public void actionPerformed(ActionEvent e) {
163164
btn.addActionListener(new ActionListener() {
164165

165166
@Override
166-
public void actionPerformed(ActionEvent e) {
167-
Object data = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null);
168-
System.out.println(data);
167+
public void actionPerformed(ActionEvent e) {
168+
new JSUtil().getClipboardText((text) -> {
169+
System.out.println(text);
170+
});
169171
}
170172

171173
});

0 commit comments

Comments
 (0)