Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 498827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:55:23+00:00 2026-05-13T05:55:23+00:00

I am creating a very basic web browser using JEditorPane just to teach myself

  • 0

I am creating a very basic web browser using JEditorPane just to teach myself Swing and GUIs in Java but am having trouble implementing a Firefox-like Google Search bar.

I’m not if it’s due to a limitation of JEditorPane or my lack of understanding but if I try and take the string typed into the “Google Search” bar and use the setPage() method of JEditorPane, it doesn’t work.

Here is my code for the ActionListener of the “Google Search” button:

public void actionPerformed(ActionEvent arg0) 
{
    try
    {
        content.setPage("http://www.google.com/search?q=" + searchBar.getText());
    }
    catch (IOException e) 
    {
        JOptionPane.showMessageDialog(frame, "Error searching for: " + searchBar.getText());
    }
}

Even when I try and just do content.setPage(“http://www.google.com/search?p=test“); it doesnt work, so is it something to do with setPage()’s way of taking the URL string? As in it doesn’t like the “?” or “=” characters or is there another way of doing it all together?

Thanks for your time,

InfinitiFizz

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T05:55:23+00:00Added an answer on May 13, 2026 at 5:55 am

    JEditorPane is a poor choice to implement even the simplest browser. It works to display simple HTML pages but it stops there.

    Try The Flying Saucer Project, it works pretty well(it’s not a full browser, but close enough).They have an example which simulates actually a web browser.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 287k
  • Answers 287k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You're passing the query directly to the function. Store it… May 13, 2026 at 5:03 pm
  • Editorial Team
    Editorial Team added an answer Since I don't specifically know what you want to do,… May 13, 2026 at 5:03 pm
  • Editorial Team
    Editorial Team added an answer By catching Throwable it includes things that subclass Error. You… May 13, 2026 at 5:03 pm

Related Questions

I'm working on an application that gets content from feeds in C#. This content
I've put together a basic applet where the user selects a file from their
I am relatively new to MVC, so this is likely a novice question. I
I am trying to figure out NSXMLParser for my iPhone app and while I
I recently wrote a node-based stack class, per instructions (specs in the comments before

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.