how to open a webpage with java
/**
* author Scratchy (Twitter @S_cratchy)
* Just import stuff
*/
import java.awt.Desktop;
import java.io.IOException;
import java.net.URI;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
This you put in your button or whatever
*/
String url_open ="HTTPS://www.google.com";
try {
java.awt.Desktop.getDesktop().browse(java.net.URI.create(url_open));
} catch (IOException ex) {
Logger.getLogger(Test.class.getName()).log(Level.SEVERE, null, ex);
}
Also in Java:
- how to use lambda in java
- creating a program about user asked to enter a number and enters 0 to stop, then calculates the sum of numbers entered, the average, the length of positive numbers and negative numbers entered by the user in java
- how do i print text in java
- main method java
- how to remove a certain string in a arraylist java
- import collections in java
- FORM EN JAVA SCRIPT
- java stack methods
- hashmaps java
- ndroid.support.v4.content.FileProvider
- convert java list to array
- java how to program
- input java
- jtable fill panel
- java set value of arraylist
- how to create a circle in java
- add two numbers bitwise
- java file class
- java loop
- enhanced for loop java
- find maven version
- parsedouble java
- set color of text for jlabel
- Building a maven EAR project and specifying the configuration of which projects to include, what is the element in the plugin configuration that contains Enterprise Java Bean Projects: