Help wanted in opening a website in JFrame??

Hi all,
I am planning to open a website in JFrame, I open up a JTextPane and use setPage(), but i get a IOException...
Do I need to open a socket or create a URL object ...
please guide..
Thanx in advance

DO U MEAN JTextPane or JEditorPane????
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.text.html.*;
import javax.swing.event.*;
import javax.swing.text.*;
import java.awt.event.*;
import java.net.*;
import java.io.*;
/* change to Jframe */
public class Ajuda extends JInternalFrame {
BorderLayout borderLayout1 = new BorderLayout();
final JEditorPane htmlPane = new JEditorPane();
final JTextField urlTextField = new JTextField();
public Ajuda() {
try {
jbInit();
catch (Exception e) {
e.printStackTrace();
public void jbInit() throws Exception {
htmlPane.setEditable(false);
urlTextField.setText("file:/index.htm");
loadPage(urlTextField.getText());
htmlPane.validate();
htmlPane.repaint();
htmlPane.addHyperlinkListener(new HyperlinkListener() {
public void hyperlinkUpdate (HyperlinkEvent event) {
if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
urlTextField.setText(event.getURL().toString());
if (event instanceof HTMLFrameHyperlinkEvent) {
HTMLDocument doc = (HTMLDocument) htmlPane.getDocument();
doc.processHTMLFrameHyperlinkEvent ((HTMLFrameHyperlinkEvent) event);
else {
loadPage(urlTextField.getText());
this.setClosable(true);
this.setIconifiable(true);
this.setMaximizable(true);
this.setResizable(true);
this.getContentPane().setLayout(borderLayout1);
this.getContentPane().add(BorderLayout.CENTER, new JScrollPane(htmlPane));
public void loadPage(String url) {
try {
htmlPane.setPage(new URL(urlTextField.getText()));
catch(Exception e) {
System.out.println(e);

Similar Messages

  • Safari doenst want to open a Website (allocine.fr) and i have a message on the console "kernel: need filter" ???

    Hello hello,
    I am a french user and i have a big problem with safari.
    Safari doenst want to open certains websites ( such as Allocine.fr) and i have a message on the console:
    09/05/2014 11:12:18,000 kernel[0]: need filter
    09/05/2014 11:12:18,000 kernel[0]: need filter
    09/05/2014 11:12:18,000 kernel[0]: need filter
    I have already disabled all the plug-ins but the problem is still here!!
    Thank you for helping me

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you turn on the computer, and again when you log in.
    Note: If FileVault is enabled, or if a firmware password is set, or if the startup volume is a Fusion Drive or a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.
    The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, restart as usual (not in safe mode) and verify that you still have the problem. Post the results of the test.

  • I want to open an website by locking the local server

    i can't opening facebook due to locking by the local server. i want to open facebook by locking or bypassing local server

    If you don't have permission to access that server, you could be prosecuted for even attempting to access it, if you would get caught - access logs are kept for most all local networks for all network connections made or attempted. As far as bypassing it, if that server is the only way to access the internet from the local network you are using - good luck. Any network admin "worth his salt" would have that covered to protect his job and protect the network he is responsible for.
    ''Beyond that, this type of discussion isn't really appropriate for this forum, as it might involve illegal "hacking" - '''Moderator''' ''.

  • When I want to open a website and I already have it open in another tab it jumps to that. How do I turn that off?

    Say I already have Facebook open. When I try to open it again in another tab, it jumps to the first tab that already has Facebook. How do I turn that off?

    The info in this post may help.
    https://discussions.apple.com/thread/3533535?start=0&tstart=0

  • Opening a website file in iWeb 08

    Hi,
    I want to open a website file/folder created in an earlier version of iWeb into iWeb 08.
    How to do this and also the folder containing all the website files is on my iDisk and not on my hard drives?

    If you don't have the original domain.sites file on your computer then you can't. There is nothing you can do.
    iWeb is not an html editor so it CANNOT import an already published site from your iDisk.
    If you can get the original domain.sites file from User/Library/Application Support/iWeb, then you can open this with iWeb 08, but if not, then you are looking at re-building your site in iWeb 08. You can use your published site as a guide to copy and paste, but nothing more.

  • I want to open Twitter, but after I type the password, it doesn't open, but the message for saving PW does appear... can you help me?

    I'm using FF on another computer, and pages that I have used in the original have opened, except for Twitter. I give the PW and the message for saving the password appears, but Twitter's HP page doesn't open, instead the registration page is the one that does... I have tried with another system and the page opens, so I know the problem isn't Twitter's, but FF's... can you help me? I want to open Twitter here...

    This issue can be caused by corrupted cookies or cookies that are blocked.
    *check the permissions on the about:permissions page and in "Tools > Page Info > Permissions"
    *https://support.mozilla.org/kb/fix-login-issues-on-websites-require-passwords
    Clear the cache and remove cookies only from websites that cause problems.
    "Clear the Cache":
    *Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > "Use custom settings for history" > Cookies: "Show Cookies"

  • I am unable to open files on amything!!! a box pops up that asks me what do i want to open the file with..every time!! I want files to open when i click on them!! This happens with emails, websites, everything

    I try to open attachments in emails and they will not open! A box comes up asking 'what do I want to open the file with', and it wants me to select from a list of options like - Firefox, IE, Word, Yahoo Browser. When I make a selection (usually Firefox) a new tab opens with a blank page! This always happens on attachments, links, websites......everything!

    These files were lost two years ago.
    That's not consistent with what you wrote in your first message. I can't help you unless I know what's going on. Either you do, or do not, have backups of all the data you want to keep. If you do not, then the first thing you need to do is back up those files. It makes zero sense to do anything else. In order to back up, you'll need either of two things: another Mac, in working order, with a FireWire port and enough space on its internal drive to hold your files; or an external drive, also with enough space.
    On the other hand, if you do have backups, or if you simply don't care about any of the data, then the solution to your problem may be quite simple. All you have to do is boot from your installation disc (your profile says you're running Mac OS 10.5), erase your internal drive, reinstall the Mac OS, then restore your data from backup. You will need to be selective in restoring software, because incompatible software may be what caused the issue.
    But it's also possible that you have a hardware failure, in which case you can't get your computer working again until it's repaired.

  • I want to open tabs and have a freedom to choose what website do I need to open in my new tab.

    I want to restore my firefox the way it used to be, when I open a new tab, that fucking babilon search keep on poping out. I want to block that website and when I open a new tab I want to see set of windows that I recently opened so I can choose which website to open. this problem started just today when I accidentally download something.

    hello juner, please look out for any suspicious 3rd-party-toolbars or things you have not installed intentionally in the programs section of the windows control panel and remove those entries.
    then go to firefox > help > troubleshooting information > profile folder - "show folder", then a new window will open up. in this window look out for a file named '''user.js''' (it is used to overwrite your custom settings). in case it is present , delete or rename this file and restart firefox afterwards.
    finally install the search reset addon - it will revert the most common customizations those adware programs do in firefox back to the default: https://addons.mozilla.org/firefox/addon/searchreset/
    [[Remove a toolbar that has taken over your Firefox search or home page]]
    <br>[[How to fix preferences that won't save]]

  • Help: Photoshop CS4, Opens Adobe Help Website Automatically. Stuck in a loop.

    Hello there!
    I am having an issue with Adobe Photoshop CS4 (part of Creative Suite Web edition).  Any action, including switching to the Photoshop windows automatically swaps out to Firefox and opens the Adobe help website.
    My current action was converting a pentool path to a selection when the problem began.
    I'm using Windows 7 on a PC.  Any help on how to resolve this would be greatly appreciated!
    Thank you.

    Hi there and thank you for responding. :-)
    I chose poor wording.  I wasn't using a predefined action when the problem started.  I used the pen tool to create a path and then right clicked to open the drop down, selected make selection and the error occured when the make selection dialogue box opened.
    The Adobe help site then opened in Firefox.  Returning to Photoshop, even just by alt-tab swapping back resulted in the help site opening again.
    Ultimaty, I didn't find a solution, and used the task manager to force Photoshop to quit/crash.
    I've had the error pop up once or twice before, but it is infrequent.  I'd just like to try to find a preventitive method or solution, as so far, any time it's started, the only thing I can do is force Photoshop to quit completely.
    I'm very sorry that I can't provide screenshots, but I hope that the explaination and additional system informaion might help.
    Additional Info:
    I don't know if this will be of any help, but my hardware setup is as follows
    Wacom Intuos 4 Tablet and Grip Pen Stylus. (The standard pen which is included with the tablet.)
    Processor: Dual Intel Core i7 CPR 920 @ 2.67 GHZ
    RAM: 12.0 GB
    Operating System: Windows 7 Home Premium Edition, 64 Bit
    Graphics Card: Dual Nvidia Gforce 9800
    And I am using Adobe Photoshop CS4, the version which ships with Adobe Creative Suite 4 Web Premium Edition.

  • When I click on the 'help' key in the elements 12 program it wants to open it in Firefox2. Firefox doesn't work on my Macbook Pro Air. I use Safari. How do I get it to open?

    When I click on the 'help' key in the elements 12 program it wants to open it in Firefox2. Firefox doesn't work on my Macbook Pro Air. I use Safari. How do I get it to open?

    Hmm, that is very strange. I agree with MichelB that it's probably best just to get the PDF, but you can try going to your username>library>preferences and deleting:
    com.adobe.PhotoshopElements.plist
    Adobe Photoshop Elements 12 settings
    Adobe Photoshop Elements 12 paths
    To see the library, click the Go menu in the Finder and hold down the option key and it will appear below the little house for your user account. While you're in there it wouldn't be a bad idea to go to the Saved Application States folder and delete anything pertaining to PSE.
    Repair permissions and see if that does it.

  • Firefox will not open, it ask if I want to send a crash report. All the questions I have read on this matter have not worked. I can open your website through internet explorer. What can I do?

    When I try to open Firefox from my desktop it will not even open to the internet, it does pop up a box that says "do you want to report this crash" I have sent the report and still can not have any luck fixing this problem. I can go to the internet if I open internet explorer and then go on your web site but it will not allow me to down load Firefox. What can I do to fix this?

    See:
    *http://kb.mozillazine.org/Firefox_crashes
    *https://support.mozilla.com/kb/Firefox+crashes
    If you have submitted Breakpad crash reports then post the IDs of one or more Breakpad crash reports (bp-xxxxxxxx-xxxxxxxxx-xxxx-xxxxxxxxxxxx).
    You can find the IDs of the submitted crash reports on the <i>about:crashes</i> page.
    You can open the <b>about:crashes</b> page via the location bar, like you open a website.
    See:
    *http://kb.mozillazine.org/Breakpad (Mozilla Crash Reporter)
    *https://support.mozilla.com/kb/Mozilla+Crash+Reporter
    *https://developer.mozilla.org/en/How_to_get_a_stacktrace_for_a_bug_report

  • Since having installed Yosemite my adobe acrobat X crashs as soon as I want to open a file, can anyone help on this issue?

    Since having installed Yosemite my adobe acrobat X crashs as soon as I want to open a file, can anyone help on this issue?

    Please try the steps below and let me know if it worked for you
    Delete all the files from following folders:
    [Home]/Library/Application Support/Adobe/SLStore
    [Home]/Library/Application Support/Adobe/SLCache
    And, delete all files from following folder except cache.db
    [Home]/Library/Application Support/Adobe/AdobePCD
    Then launch Acrobat and try to activate and check.
    Regards,
    Rave

  • After upgrading to 6.0 firefox will not open ant websites at all, while my other browsers work correctly: help, please

    i run windows 7 on a sony y series. before upgrading to 6.0 firefox worked seamlessly. now it will not open any websites at all. i have uninstalled and reinstalled it to no avail. thoughts? help? ...

    I will be using IE9 until this is fixed. Perhaps for good!!

  • I want to open a radio file that is .rm.  I get a message that says I need additional Quicktime software, but I cannot locate what I need to download on the QT website.  Anyone got ideas about how I can open this file?

    I want to open a radio file that is .rm.  I get a message that says I need additional Quicktime software, but I cannot locate what I need to download on the QT website.  Anyone got ideas about how I can open this file?

    Hi bert,
    the ".rm" extension is created by 'Real Media' application.
    The easiest way to use it is to install the 'Real Media' player:
    1. RealPlayer BBC.app
    2. RealPlayer 12.app
    I have both installed & use them sometimes.
    (The 'BBC' wersion doesn't have any adverts with-in the app.)

  • I cant open any websites in firefox(version 25) ,its loading long time ,help plz

    i cant open any websites in firefox(version 25) ,its loading long time ,help plz

    hello, normally such issues are caused by a firewall/security software which doesn't recognize & therefore blocks new firefox versions: [[Fix problems connecting to websites after updating Firefox]]

Maybe you are looking for

  • While Creation Of SaleOrder Char Values are not getting saved.(V C)

    Hi SAP gurus, One of my client can able to create a saleorder but when we go and see in VA03 Display mode,we found Charactrestic values getting miised out.What could be the probale reasons. Note: I Have stimulate the required combination as per my cl

  • Ipod wont start up

    My 3G Ipod got disconnected while applying the latest update. Now It wont mount to my pc. When I plug in the Ipod the Apple symbol Appers for a few seconds, then a picture of the Ipod plug (the part that plugs into the bottom of the Ipod) appers on t

  • Safari Won't Load!?

    I don't recall installing anything new or unusual on my computer, but for some unknown reason, Safari will no longer open for me. It bounces onto the dock, and then says, "The application Safari has unexpectedly quit," before it can even open a windo

  • MD07 - Light need to be green after PR created

    Hi all , My customer raises a reasonable request: In MD07 when there is a shortage (Minus stock)  the light is red . OK. However, after he creates a PR covering this shortage, he wants that the light will go Yellow . Sounds reasonable, right? I coukl

  • Restore files with recovery manager

    I have a presario CQ62 win 7 laptop.  I had to do a system restore because pc would not boot.  selected option to create a back up of files and settings onto extenal hard drive.  after restoring the OS i attemped to use recovery manager to restore fi