Skip to content

Commit 9e97884

Browse files
hansonrhansonr
authored andcommitted
tests
1 parent 6c4086f commit 9e97884

File tree

4 files changed

+28
-2
lines changed

4 files changed

+28
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20200807063741
1+
20200811045955
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20200807063741
1+
20200811045955

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package test;
22

3+
34
import static java.awt.Color.getColor;
45
import static java.awt.Toolkit.getDefaultToolkit;
56

@@ -25,6 +26,15 @@
2526
;
2627
class Test_Class extends Test_Class2<Integer> {
2728

29+
static class TestStatic {
30+
31+
static String sayHello() { return "Hello there"; }
32+
}
33+
34+
35+
36+
37+
2838
public int test_int = 3; // shadows Test_
2939

3040

@@ -324,6 +334,10 @@ public static String localtest() {
324334

325335
public static void main(String[] args) {
326336

337+
TestStatic ts = null;
338+
339+
System.out.println(ts.sayHello());
340+
327341
// System.out.println(new Date() + " " + Date.parse("3/4/2020"));
328342

329343
System.out.println(Number.class.isAssignableFrom(Double.class));

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.awt.EventQueue;
66
import java.awt.Font;
77
import java.awt.GridLayout;
8+
import java.awt.Toolkit;
89
import java.awt.event.ActionEvent;
910
import java.awt.event.ActionListener;
1011
import java.util.Date;
@@ -157,6 +158,17 @@ public void actionPerformed(ActionEvent e) {
157158

158159
});
159160

161+
m.add(btn, null);
162+
btn = new JButton("paste");
163+
btn.addActionListener(new ActionListener() {
164+
165+
@Override
166+
public void actionPerformed(ActionEvent e) {
167+
Object data = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null);
168+
System.out.println(data);
169+
}
170+
171+
});
160172
m.add(btn, null);
161173
add(m, BorderLayout.SOUTH);
162174

0 commit comments

Comments
 (0)