Results 1 to 8 of 8

Thread: How to create Web Browser with the help of JAVA

  1. #1
    Join Date
    Feb 2009
    Posts
    105

    How to create Web Browser with the help of JAVA

    Hello Programming Gurus,

    Today I get the Assignment from the college for creating the Web browser with the help of JAVA.

    I have done Enough programming in the JAVA but I am little confused in creating the web browser, what all tools would be required so that I can save my time in codding each pane of my web site, again which method I have to make use of in my Programming.

    please help.

  2. #2
    Join Date
    Mar 2008
    Posts
    232

    Re: How to create Web Browser with the help of JAVA

    Do you mean actually write a component that acts like a browser? You will need to implement HTML and JavaScript and ... . You can look at some opensource java browser projects to get started.

    Do you mean use a browser component? Well there is JDIC, Commercial browser components and JRex.

  3. #3
    Join Date
    Feb 2009
    Posts
    105

    Re: How to create Web Browser with the help of JAVA

    Hi, Nice to see your Reply. I want to create a Web Browser Project, Not a componenet. Can you tell me some open source browsers developed in java.
    I dont want to embedd other default browsers.

    After that I want to use character encoding in this project.
    Thank You

  4. #4
    Join Date
    Dec 2008
    Posts
    183

    Re: How to create Web Browser with the help of JAVA

    The WebBrowser.setContent() function is perfect for loading your own machine-generated content, and events can be captured and processed appropriately. It would even be possible to have a hybrid application, with part of the interface being straight Processing and the rest AWT. I’m keen to try using this to create more complex on-screen layouts. HTML and CSS will always look much better than anything one could create using Swing.

  5. #5
    Join Date
    Jan 2012
    Location
    Redfern NSW Australia
    Posts
    1

    Re: How to create Web Browser with the help of JAVA

    please let me know what subjects i need to take to be able create a good web browser without commercial aid(pre-developed), i've learnt how to create a dynamic webpage

  6. #6
    Join Date
    Jun 2006
    Posts
    623

    Re: How to create Web Browser with the help of JAVA

    Quote Originally Posted by himclay View Post
    please let me know what subjects i need to take to be able create a good web browser without commercial aid(pre-developed), i've learnt how to create a dynamic webpage
    I have made an unfinished web browser in java that might be a good start for you, check the below code:
    Code:
    import javax.swing.*;
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    
    public class WebBrowser extends JFrame {
    
    	public JPanel
    		address_panel, window_panel;
    
    	public JLabel
    		address_label;
    
    	public JTextField
    		address_tf;
    
    	public JEditorPane
    		window_pane;
    
    	public JScrollPane
    		window_scroll;
    
    	public JButton
    		address_b;
    
    	private Go go = new Go();
    
    	public WebBrowser() throws IOException {
    
    		// Define address bar
    		address_label = new JLabel(" address: ", SwingConstants.CENTER);
    		address_tf = new JTextField("http://www.yahoo.com");
    		address_tf.addActionListener(go);
    		address_b = new JButton("Go");
    		address_b.addActionListener(go);
    
    		window_pane = new JEditorPane("http://www.yahoo.com");
    		window_pane.setContentType("text/html");
    		window_pane.setEditable(false);
    
    		address_panel = new JPanel(new BorderLayout());
    		window_panel = new JPanel(new BorderLayout());
    
    		address_panel.add(address_label, BorderLayout.WEST);
    		address_panel.add(address_tf, BorderLayout.CENTER);
    		address_panel.add(address_b, BorderLayout.EAST);
    
    		window_scroll = new JScrollPane(window_pane);
    		window_panel.add(window_scroll);
    
    		Container pane = getContentPane();
    		pane.setLayout(new BorderLayout());
    
    		pane.add(address_panel, BorderLayout.NORTH);
    		pane.add(window_panel, BorderLayout.CENTER);
    
    		setTitle("web browser");
    		setSize(800,600);
    		setVisible(true);
    		setDefaultCloseOperation(EXIT_ON_CLOSE);
    
    	}
    
    	public class Go implements ActionListener{
    
    		public void actionPerformed(ActionEvent ae){
    
    			try {
    
    				window_pane.setPage(address_tf.getText());
    
    			} catch (MalformedURLException e) {     // new URL() failed
    				window_pane.setText("MalformedURLException: " + e);
    			} catch (IOException e) {               // openConnection() failed
    				window_pane.setText("IOException: " + e);
    			}
    
    		}
    
    	}
    
    	public static void main(String args[]) throws IOException {
    		WebBrowser wb = new WebBrowser();
    	}
    
    }

  7. #7
    Join Date
    Mar 2012
    Posts
    1

    Re: How to create Web Browser with the help of JAVA

    how create in mobile version??
    and what specific jar for this?

  8. #8
    Join Date
    Jan 2006
    Posts
    605

    Re: How to create Web Browser with the help of JAVA

    Quote Originally Posted by boymagi View Post
    how create in mobile version??
    and what specific jar for this?
    Mobile browsers render web pages differently from desktop browsers, so some steps are needed to make them work well on phones. This article here contains some basic technical and non-technical tips for making your web content faster and more suitable for consumption on mobile devices.

Similar Threads

  1. If java is enabled Safari browser crashes
    By Pirateous in forum Technology & Internet
    Replies: 6
    Last Post: 17-04-2012, 08:47 PM
  2. Running the Java Swing application in a Web browser
    By Namuchi in forum Software Development
    Replies: 5
    Last Post: 23-07-2010, 03:33 AM
  3. Android java capable browser
    By Gajendra1 in forum Portable Devices
    Replies: 6
    Last Post: 14-06-2010, 10:31 AM
  4. How to create an inner class in java?
    By MABON in forum Software Development
    Replies: 4
    Last Post: 01-02-2010, 04:40 PM
  5. HtmlUnit 2.4 - a headless java browser released
    By Pyrotechnic in forum Technology & Internet
    Replies: 1
    Last Post: 05-01-2009, 12:15 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,710,828,933.19760 seconds with 16 queries