Ir ao conteúdo
  • Cadastre-se

fazer um navegador simples em java pelo netbeans 8


Posts recomendados

olá boa noite estou tentado um projeto aqui preciso da ajuda de vocês sou leigo nessa área .

Meu projeto :

Cria um navegador em java simples para rodar um site especifico que permita  baixar arquivos, fazer uploader e  imprimir desse site 

eu estou tentando modificar esse navegador aqui 

import javafx.application.Platform; import javafx.embed.swing.JFXPanel; import javafx.scene.Scene; import javafx.scene.layout.BorderPane; import javafx.scene.web.WebView; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class SwingHtmlDemo { public static void main(String [] args){ SwingUtilities.invokeLater(new Runnable() { @Override public void run() { ApplicationFrame mainFrame = new ApplicationFrame(); mainFrame.setVisible(true); } }); } } /** * Main window used to display some HTML content. */ class ApplicationFrame extends JFrame{ JFXPanel javafxPanel; WebView webComponent; JPanel mainPanel; JTextField urlField; JButton goButton; public ApplicationFrame(){ javafxPanel = new JFXPanel(); initSwingComponents(); loadJavaFXScene(); } /** * Instantiate the Swing compoents to be used */ private void initSwingComponents(){ mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); mainPanel.add(javafxPanel, BorderLayout.CENTER); JPanel urlPanel = new JPanel(new FlowLayout()); urlField = new JTextField(); urlField.setColumns(50); urlPanel.add(urlField); goButton = new JButton("Go"); /** * Handling the loading of new URL, when the user * enters the URL and clicks on Go button. */ goButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Platform.runLater(new Runnable() { @Override public void run() { String url = urlField.getText(); if ( url != null && url.length() > 0){ webComponent.getEngine().load(url); } } }); } }); urlPanel.add(goButton); mainPanel.add(urlPanel, BorderLayout.NORTH); this.add(mainPanel); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setSize(700,600); } /** * Instantiate the JavaFX Components in * the JavaFX Application Thread. */ private void loadJavaFXScene(){ Platform.runLater(new Runnable() { @Override public void run() { BorderPane borderPane = new BorderPane(); webComponent = new WebView(); webComponent.getEngine().load("http://google.com/"); borderPane.setCenter(webComponent); Scene scene = new Scene(borderPane,450,450); javafxPanel.setScene(scene); } }); } }

mais ainda não tirei a caixa de pesquisa e o botão "go" , mas o que to precisando e colocar essa opção de baixar, fazer uploader e imprimir pelo site especifico 

espero que me ajudem abraços 

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novas respostas.

Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×
×
  • Criar novo...