Estou muito grato pelo codigo e pela ajuda, mas preciso de um frame que chama direto o endereço(Página) e mostre no frame sem botão sem nada algo mais simples.
Se puder melhorar este agradeço
O que ocorre quando passo a String com a URL não obtenho sucesso gostaria de ter uma forma de passar a URL no codigo e me retornasse a pagina desejada direto sem botão.
import javax.swing.*;
import java.awt.*;
import java.io.IOException;
import java.net.URI;
import java.text.CharacterIterator;
import java.text.StringCharacterIterator;
public class Conceitohtml{
public Conceitohtml() throws IOException{
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container con = frame.getContentPane();
String path = "http://www.google.com.br"; URL url = new URL(path);
//String URL = ("file:///"+System.getProperty("user.dir") + "/mytest.html");
//URL URL1 = "www.";
//String novo=(URL1);
//JEditorPane jep = new JEditorPane(novo);
//JScrollPane jsp = new JScrollPane(jep);
//con.add(jsp);
frame.setBounds(50, 50, 600, 500);
frame.setVisible(true);
}
public static String URLCaracteresInvalidos(String URL){
final StringBuilder resultado = new StringBuilder();
final StringCharacterIterator iterator = new StringCharacterIterator(URL);
char character = iterator.current();
while (character != CharacterIterator.DONE ) {
if (character == '\\') {
resultado.append("/");
} else if (character == ' ') {
resultado.append("%20");
} else {
resultado.append(character);
}
character = iterator.next();
}
return resultado.toString();
}
public static void main(String[] args) throws IOException{
Conceitohtml exibeHtml=new Conceitohtml();
}
}