Skip to content

Commit d5e51f9

Browse files
Use example-specific web-pages for Java examples (#157)
In this changeset, we have utilized example-specific web-pages for our examples. Issue: TeamDev-IP/JxBrowser/issues/4091
1 parent 3c35ccb commit d5e51f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+66
-64
lines changed

examples/src/main/java/com/teamdev/jxbrowser/examples/DefaultZoomLevel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@ public void windowClosing(WindowEvent e) {
6161

6262
engine.zoomLevels().defaultLevel(ZoomLevel.P_300);
6363

64-
browser.navigation().loadUrl("https://www.google.com");
64+
browser.navigation().loadUrl("https://html5test.teamdev.com");
6565
}
6666
}

examples/src/main/java/com/teamdev/jxbrowser/examples/DisableZoom.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void windowClosing(WindowEvent e) {
5959
frame.setVisible(true);
6060
});
6161

62-
browser.navigation().loadUrlAndWait("https://www.google.com");
62+
browser.navigation().loadUrl("https://html5test.teamdev.com");
6363

6464
// Disabling zoom.
6565
browser.zoom().disable();

examples/src/main/java/com/teamdev/jxbrowser/examples/FilterCookies.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,6 @@ public void windowClosing(WindowEvent e) {
7272
return CanGetCookiesCallback.Response.cannot();
7373
});
7474

75-
browser.navigation().loadUrl("https://www.google.com");
75+
browser.navigation().loadUrl("https://html5test.teamdev.com");
7676
}
7777
}

examples/src/main/java/com/teamdev/jxbrowser/examples/FilterImages.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,10 @@
3535
import javax.swing.WindowConstants;
3636

3737
/**
38-
* This example demonstrates how to handle all resources such as HTML, PNG,
39-
* JavaScript, CSS files, and decide whether web browser engine should load
40-
* them from web server.
38+
* This example demonstrates how to handle all resources such as HTML, PNG, JavaScript, CSS files
39+
* and decide whether web browser engine should load them from web server or not.
4140
*
42-
* <p>In this example we cancel loading of all images.
41+
* <p>For example, in this example we cancel loading of all images.
4342
*/
4443
public final class FilterImages {
4544

@@ -71,6 +70,6 @@ public void windowClosing(WindowEvent e) {
7170
return BeforeUrlRequestCallback.Response.proceed();
7271
});
7372

74-
browser.navigation().loadUrl("https://www.google.com");
73+
browser.navigation().loadUrl("https://webglsamples.org/");
7574
}
7675
}

examples/src/main/java/com/teamdev/jxbrowser/examples/FindText.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,6 @@ public void windowClosing(WindowEvent e) {
6565
frame.setVisible(true);
6666
});
6767

68-
browser.navigation().loadUrl("https://www.google.com");
68+
browser.navigation().loadUrl("https://html5test.teamdev.com/");
6969
}
7070
}

examples/src/main/java/com/teamdev/jxbrowser/examples/InterceptRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public void windowClosing(WindowEvent e) {
6868
frame.setVisible(true);
6969
});
7070

71-
browser.navigation().loadUrl("https://www.google.com");
71+
browser.navigation().loadUrl("https://html5test.teamdev.com/");
7272
}
7373

7474
private static final class InterceptHttpsCallback implements InterceptUrlRequestCallback {

examples/src/main/java/com/teamdev/jxbrowser/examples/LoadUrl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ public void windowClosing(WindowEvent e) {
5959
frame.setVisible(true);
6060
});
6161

62-
browser.navigation().loadUrl("https://www.google.com");
62+
browser.navigation().loadUrl("https://html5test.teamdev.com/");
6363
}
6464
}
65-

examples/src/main/java/com/teamdev/jxbrowser/examples/LocalWebStorage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public final class LocalWebStorage {
3939
public static void main(String[] args) {
4040
try (Engine engine = Engine.newInstance(OFF_SCREEN)) {
4141
Browser browser = engine.newBrowser();
42-
browser.navigation().loadUrlAndWait("https://www.google.com");
42+
browser.navigation().loadUrlAndWait("https://html5test.teamdev.com/");
4343
browser.mainFrame().ifPresent(frame -> {
4444
frame.localStorage().putItem(KEY, "Tom");
4545
System.out.println((String) frame.executeJavaScript(

examples/src/main/java/com/teamdev/jxbrowser/examples/PrintFromJava.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@
3535
import javax.swing.WindowConstants;
3636

3737
/**
38-
* This example demonstrates how to show the print preview dialog where
39-
* an end-user can select the required printing options and print the currently
40-
* loaded web page.
38+
* This example demonstrates how to show the Print Preview dialog where you can select the required
39+
* printing options and print the currently loaded web page.
4140
*/
4241
public final class PrintFromJava {
4342

@@ -65,7 +64,7 @@ public void windowClosing(WindowEvent e) {
6564
frame.setLocationRelativeTo(null);
6665
frame.setVisible(true);
6766

68-
browser.navigation().loadUrl("https://www.google.com");
67+
browser.navigation().loadUrl("https://en.wikipedia.org/wiki/Printing");
6968
});
7069
}
7170
}

examples/src/main/java/com/teamdev/jxbrowser/examples/PrintSettings.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
import com.teamdev.jxbrowser.print.event.PrintCompleted;
3737

3838
/**
39-
* This example demonstrates how to print the currently loaded web page
40-
* via the default system printer.
39+
* This example demonstrates how to configure print settings programmatically and print the
40+
* currently loaded web page on the default system printer.
4141
*/
4242
public final class PrintSettings {
4343

@@ -77,7 +77,7 @@ public static void main(String[] args) {
7777
// #enddocfragment "Proceed"
7878
});
7979
// #enddocfragment "Callback"
80-
browser.navigation().loadUrlAndWait("https://google.com");
80+
browser.navigation().loadUrlAndWait("https://en.wikipedia.org/wiki/Printing");
8181
browser.mainFrame().ifPresent(Frame::print);
8282
}
8383
}

0 commit comments

Comments
 (0)