WebBrowser Via Proxy

2 respostas
jpros
Ola, consegui um código de web, fiz algumas modificações nele, já procurei na internet e o que achei não me ajudou. Tenho o seguinte código:
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.io.*;

/**
 *
 * @author root
 */
public class Browser extends JFrame implements HyperlinkListener{
 public static void main(String[] args) {
      new Browser("http://www.guj.com.br");
  }

  private JEditorPane htmlPane;
  private String initialURL;

  public Browser(String initialURL) {
    super("Web");
    this.initialURL = initialURL;
    addWindowListener(new ExitListener());
    WindowUtilities.setNativeLookAndFeel();
    JPanel topPanel = new JPanel();
    topPanel.setBackground(Color.lightGray);
    JLabel urlLabel = new JLabel("Web");
    topPanel.add(urlLabel);
    getContentPane().add(topPanel, BorderLayout.NORTH);

    try {
        htmlPane = new JEditorPane(initialURL);
        htmlPane.setEditable(false);
        htmlPane.addHyperlinkListener(this);
        JScrollPane scrollPane = new JScrollPane(htmlPane);
        getContentPane().add(scrollPane, BorderLayout.CENTER);
        
    } catch(IOException ioe) {
       warnUser("Serviço temporariamente indisponível!");
    }

    int width = 220;
    int height = 400;
    setBounds(width/8, height/8, width, height);
    setVisible(true);
  }

private void warnUser(String message) {
    JOptionPane.showMessageDialog(this, message, "Erro de Conexão", 
                                  JOptionPane.ERROR_MESSAGE);
  }
public void hyperlinkUpdate(HyperlinkEvent e) {
    throw new UnsupportedOperationException("Não implementado");
}
}

e gostaria de poder acessa-lo por traz de um proxy, gostaria de poder fazer essa configuração toda vez que acessar ele.
Pois em um curso tenho um proxy, e no outro tenho um proxy com autenticação, então gostaria de fazer que toda vez ele peça uma configuração de proxy ou se as configurações forem em branco ele conectar diretamente, sem proxy.

Alguem saberia me ajudar?
Obrigado a todos

2 Respostas

jpros

alguém?

jpros

bom, achei a dica, apesar da falta de colaboração, porém descobri que não é compativel javascript nem flash…
Alguém teria alguma sujestão?

Criado 2 de outubro de 2008
Ultima resposta 5 de out. de 2008
Respostas 2
Participantes 1