Skip to content

Commit f47b755

Browse files
hansonrhansonr
authored andcommitted
test files
1 parent dacf0ec commit f47b755

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ public void propertyChange(PropertyChangeEvent evt) {
5858
pleft.setEnabled(false);
5959
lblBottom.setText("disabled");
6060
cb.setEnabled(false);
61-
if (p.getDividerLocation() > p.getWidth() * 0.75)
62-
p.setDividerLocation(0.75);
61+
if (p.getDividerLocation() > p.getWidth() * 0.75) {
62+
//p.setDividerLocation(0.75);
63+
p.setDividerLocation((int)(p.getWidth() * 0.45));
64+
}
6365
break;
6466
case "lastDividerLocation":
6567
break;

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

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,11 @@ public static void main(String[] args) {
3737
URL url = new URL("http://www.ebi.ac.uk/pdbe/api/pdb/entry/summary/1cbs");
3838

3939
JSUtil.setAjax(url);
40-
/**
41-
* @j2sNative
42-
*
43-
* url.ajax = {dataType:"json"};
44-
*/
4540
Object data = url.getContent();
4641
/**
4742
* @j2sNative
4843
*
49-
* data = data._ajaxData;
44+
* data = data._jsonData;
5045
*
5146
* data = data["1cbs"][0].title;
5247
*/
@@ -68,11 +63,7 @@ public static void main(String[] args) {
6863
false) {
6964
// JavaScript-only code
7065
url = new URL("http://www.ebi.ac.uk/pdbe/api/pdb/entry/summary/1d66");
71-
JSUtil.setAjax(url);
72-
73-
74-
BufferedReader br = JSUtil.getJSONReader((InputStream) url.getContent());
75-
data = JSUtil.parseJSON(br);
66+
data = JSUtil.parseJSON(url);
7667
String title = (((Map<String, java.util.List<Map<String, String>>>) data).get("1d66")).get(0)
7768
.get("title");
7869
System.out.println(title);

0 commit comments

Comments
 (0)