Take the screenshot of the webpage using java [duplicate] - java

This question already has answers here:
Take a screenshot of a web page in Java [closed]
(6 answers)
Closed 6 years ago.
I'am trying to take the screenshot of the webpage using java code. I am using google api to get the screenshot.But it has only limited offer and not free.Can anyone help me to get the code

In a webpage you can use a html2canvas in HTML 5.
For more you can read here.
Something like this:
To run html2canvas on an element with some options simply call:
html2canvas(element, options);
The rendered canvas is provided in the callback event onrendered, as
such:
html2canvas(element, {
onrendered: function(canvas) {
// canvas is the final rendered <canvas> element
}
});
For more read here: https://html2canvas.hertzen.com/documentation.html.
To do it Java read this answer.

Related

How can i use getResource(...) to grab the .png file from resources [duplicate]

This question already has an answer here:
How do I determine the correct path for FXML files, CSS files, Images, and other resources needed by my JavaFX Application?
(1 answer)
Closed 10 months ago.
Project Structure
This is one of things I have tried:
In class 'EditScreenController.java':
Button placeholderEdit = new Button();
Image pencil = new Image(getClass().getResourceAsStream("pencil.png"));
placeholderEdit.setGraphic(new ImageView(pencil));
Result:
Input stream must not be null
I know it's something super simple, and yet I have already tried multiple things :( . Would highly appreciate a working answer.
Enjoy the rest of your day!
Image pencil = new Image(getClass().getResourceAsStream("/img/pencil.png"));
This solved my issue.

using javafx 8 (java 8 install) How to extend Label.setTooltip Display time to 20secs (while mouse is inside Tooltip) [duplicate]

This question already has answers here:
How to control the JavaFX Tooltip's delay?
(8 answers)
Closed 7 years ago.
I have tried Using
1)
import javax.swing.ToolTipManager;
ToolTipManager.sharedInstance().setDismissDelay(20000);
at various locations in *.java file (using NetBeans IDE)
2) Creating OnMouseEnter MouseEvent Handler Override routine including:
ToolTipManager.sharedInstance().setDismissDelay(20000);
Results: No Errors, Runs fine, Except Display Time is ALWAYS 5secs!!!
I would prefer NOT creating my own Popup Control, because I like all the Behavior of existing Tooltip, except Im trying to Display Several words in Tooltips that User Needs to take Long Time to Read. Please Help!!!!!
You're calling a Swing utility class, i.e. import javax.swing.ToolTipManager, this has no control over JavaFX functionality.
According to control JavaFX Tooltip delay, this is not supported and the subject of a change request. That question also contains a reflection based 'hack' and another workaround involving popups.

How to create this layer on my app to teach users? [duplicate]

This question already has answers here:
How do I create the semi-transparent grey tutorial overlay in Android?
(5 answers)
Closed 7 years ago.
I want create layer like below to teach users if you click on some position you can use some service.sorry I don't know what is it that I search on the web
Easily achieved with ShowcaseView: https://github.com/amlcurran/ShowcaseView

Customizing Spinner Android? [duplicate]

This question already has answers here:
Strange Spinner. How to fix it?
(4 answers)
Closed 8 years ago.
I have spinner and code android.R.layout.simple_spinner_dropdown_item.
But I get weird height like this:
I want to have dropdown_items like they are by default but also I don't want to have weird height on the main screen.
Use the adapter.setDropDownViewResource(int resId) method to use a specific layout for the dropdown box (not the elements)
As seen here

Java tile map loader [duplicate]

This question already has an answer here:
Closed 11 years ago.
Possible Duplicate:
Android custom control to display map tiles
I'm new with java and I'm wondering. How would I make a tile map loader in it? Can someone point me in the right direction with tutorials or something please? Thanks!
I assume you mean you want to create a slippy map application with Android. I'm not aware of any tutorials in this area. But there are plenty of open-source projects you can learn from here. Here's a simple one you can start with: MapDroid.

Categories