Help under JEditorPane

Hi All,
I am having a small class file in which i am using JEditorPane for opening an URL.So when i make a pane.setPage(url)..it is going into the catch block and hitting me an error instead of executing try block.Any idea why this is happening..???
I am even attaching my piece of code.
public class EditorPaneExample1 extends JFrame {
     String url;
     private JEditorPane pane;
private JTextField textField;
private JButton go;
public EditorPaneExample1() {
super("URL Opening Window");
pane = new JEditorPane();
pane.setEditable(false);
getContentPane().add(new JScrollPane(pane), "Center");
go=new JButton("GO");
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout(4, 4));
JLabel urlLabel = new JLabel("URL: ", JLabel.RIGHT);
panel.add(urlLabel, "West");
textField = new JTextField(32);
panel.add(textField, "Center");
panel.add(go,"East");
getContentPane().add(panel, "South");
     tst_Load();
private void tst_Load(){
// Change page based on text field
textField.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
if(evt.getSource()==textField){
go.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){
if(ae.getSource()==go){
                              url = textField.getText();
Go(url);
private void Go(String newURL){
     System.out.println("URL Coming is:"+newURL);
try {
// Try to display the page
pane.setPage(url);
} catch (IOException e) {
JOptionPane.showMessageDialog(pane, new String[] {
"Unable to open the file", url },
                    "File Open Error",
JOptionPane.ERROR_MESSAGE);
public static void main(String[] args) {
try {
} catch (Exception evt) {}
JFrame f = new EditorPaneExample1();
f.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent evt) {
System.exit(0);
f.setSize(500, 400);
f.setVisible(true);
Help me out.
Thanks in advance.

Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.
it is going into the catch block and hitting me an error instead of executing try block.Any idea why this is happening..???No and we will never know because you don't display an error message in the catch block.

Similar Messages

  • I ask to help under repair MS-6398.

    I ask to help under repair MS-6398. Mosfet marked as "С5001" has burned down. Probably MSI
    has destroyed the present (true) marks of a microcircuit. I ask to help to pick up analogue.
    MS-6398 the worthy motherboard, but does not work from such trifle.

    If the board is still under warrenty MSI will take care of it.

  • Help with JEditorPane :). Please help...

    Hi there,
    I can not find out how the JEditorPane get's its' information on which Text to show.
    I know that there is a Document, representing the text information and an EditorKit, offering main functionality for editing, but what methods are actually called from where to get the text that is stored in the document?
    What methods are called from where?
    Could anyone help me please, I am rather desperate.
    Thank you very much
    Charly

    Here is a link to a section in the Swing tutorial that shows you how to use text components (JTextField, JTextArea, JEditorPane, JTextPane):
    http://java.sun.com/docs/books/tutorial/uiswing/components/text.html

  • Help! JEditorPane flickers! (10 Dukes)

    Greetings,
    I am working to display news from a web server in a JEditorPane.
    I receive news from an outside source; I have an interface program to gather, parse and create a html
    news file (index.html) with links to the actual news articles in it. I update this html file as soon as I receive new news articles.
    Now, on the client side, I simply use the JEditorPane's setPage method to assign the index html page.
    So far so good, however when the incoming news traffic is heavy, the html file is getting updated almost
    every second and consequently the setPage method is getting called everys second. And needless to say
    JEditorPane flickers like it has bird flu.
    Is there a way to eliminate or at least reduce the flicker?
    Cheers
    Vic
    //Simulating news a minute:
    java.util.Timer timer = new java.util.Timer();
    timer.schedule(new refreshNews(), 1 * 1000, 1 * 1000);
    private class refreshNews extends TimerTask{
    public refreshNews(){}
    public void run(){
    try{
    pane.setPage(url);
    }catch(Exception err){
    err.printStackTrace();

    Have you tried playing with JEditorPane's setDoubleBuffered( ) option?
    This might help with the screen flicker.
    Also, if you are running a separate timer thread, you should call the setPage( ) method on the Event Dispatcher thread, as Swing components are generally not thread-safe. ie.
    SwingUtilities.invokeLater(new Runnable( )
      public void run( )
        // setPage call here

  • Help! JEditorPane flickers!

    Greetings,
    I am working to display news from a web server in a JEditorPane.
    I receive news from an outside source; I have an interface program to gather, parse and create a html
    news file (index.html) with links to the actual news articles in it. I update this html file as soon as I receive new news articles.
    Now, on the client side, I simply use the JEditorPane's setPage method to assign the index html page.
    So far so good, however when the incoming news traffic is heavy, the html file is getting updated almost
    every second and consequently the setPage method is getting called everys second. And needless to say
    JEditorPane flickers like it has bird flu.
    Is there a way to eliminate or at least reduce the flicker?
    Cheers
    Vic
    //Simulating news a minute:
    java.util.Timer timer = new java.util.Timer();
    timer.schedule(new refreshNews(), 1 * 1000, 1 * 1000);
    private class refreshNews extends TimerTask{
    public refreshNews(){}
    public void run(){
    try{
    pane.setPage(url);
    }catch(Exception err){
    err.printStackTrace();

    Have you tried playing with JEditorPane's setDoubleBuffered( ) option?
    This might help with the screen flicker.
    Also, if you are running a separate timer thread, you should call the setPage( ) method on the Event Dispatcher thread, as Swing components are generally not thread-safe. ie.
    SwingUtilities.invokeLater(new Runnable( )
      public void run( )
        // setPage call here

  • Help under Help

    Could someone tell me why my Help On Premier Elements 7 under HELP or F1 does not bring up help? I can get to online help but prefer first to try my programs knowledge base. Thank you   Karl

    See this FAQ:
    http://www.johnrellis.com/psedbtool/photoshop-elements-faq.htm#_The_Help_command

  • Help in jeditorpane

    Hi All,
    I am trying to input a text in jeditrpane but its not accepting any formatting and hyperlinks,bullets and numbering how i can achieve this and also i want to save it in the same format in database MySql how can i do this also while retriving from the database i want to view the contents in the same format in a webpage.can anyone please help me for this.
    R.Ramesh.

    JEditorPane requires specifying contentType property the value of which is a MIME type.
    If the value is "text/html", then the document fed to it should be a proper HTML based on HTML 3.1 standard.

  • Audio Help Under ALSA

    Hey,
    I can't get sound working (just none of it).
    According to audio via lspci | grep -i audio I have the following card:
    00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)
    I followed all the directions at the arch sound wiki but to no avail...
    Here is the modules line of my rc.conf file:
    MODULES=(i2c-i801 eeprom coretemp !ath_pci wl lib80211_crypt_tkip !snd_intel8x0m)
    I really don't know anything about sound, just followed the wiki, if there's any other files/information you need that can better assist you, please let me know.
    Thanks in advance for your help.

    Ah, yes, sorry, should have known to include the grep of snd from the modules, here:
    lsmod | grep snd
    snd_seq_oss 29696 0
    snd_seq_midi_event 6004 1 snd_seq_oss
    snd_seq 47856 4 snd_seq_oss,snd_seq_midi_event
    snd_seq_device 6016 2 snd_seq_oss,snd_seq
    snd_pcm_oss 36832 0
    snd_mixer_oss 14132 2 snd_pcm_oss
    snd_hda_codec_realtek 189336 1
    snd_hda_intel 24872 1
    snd_hda_codec 60212 2 snd_hda_codec_realtek,snd_hda_intel
    snd_hwdep 6904 1 snd_hda_codec
    snd_pcsp 9228 0
    snd_pcm 66936 4 snd_pcm_oss,snd_hda_intel,snd_hda_codec,snd_pcsp
    snd_timer 19132 2 snd_seq,snd_pcm
    snd 51108 12 snd_seq_oss,snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcsp,snd_pcm,snd_timer
    soundcore 6112 2 snd
    snd_page_alloc 8124 2 snd_hda_intel,snd_pcm
    As for the the second command, no idea what that is, but here it is :-P.
    amixer sget PCM
    Simple mixer control 'PCM',0
    Capabilities: pvolume
    Playback channels: Front Left - Front Right
    Limits: Playback 0 - 255
    Mono:
    Front Left: Playback 217 [85%] [-7.60dB]
    Front Right: Playback 217 [85%] [-7.60dB]
    I appreciate the effort thus far, comparing the lsmod of mine to the lsmod of the arch wiki I feel that some kernel modules may have not been installed.  Although I followed all the directions for sound on the arch wiki so I don't know.

  • Help with JEditorPane

    Hi all,
    I'm developing a component which will be able to display HTML. I'm using the JEditorPane componenet. Problem is, when I try to display html pages which have JavaScript, the script is not executed. Is there anyway I can solve this?

    Anyone have any luck? I have read that JEditorPane doesn't support Javascript. Where can I find this information.
    Thanks in advance.

  • New HP Envy 15 wont start and HP Support wont help under warranty

    Seems that once you purchase an HP product these days and register it online and show the warranty data that HP will not do any warranty work for you unless you produce the sales receipt.  I work internationally and travel the world.  Recently purchased an HP Envy 15 in Los Angelas in April 2012.  It was a fantastic machine till two days ago when it decided to just quit.  Nothing, no indications, no fan, no noise just dead.  I troubleshot the cord, the power, the battery and had IT look at it and it appears to be a motherboard issue.  So I contacted support only to learn that because I dont carry every purchase receipt I have for all products i have purchased in my life and one of them being this Laptop, they refused to work on it even though it is clearly registered and shows that it has a warranty!  Once again HP has let its customers down and put in place a policy that is rediculous and uncalled for to protect themselves from anyone ever using thier service, if that is what they actually have?  I suspect it is just a call center and there is not a repair station and they just use the receipt as an excuse because as I tried to go higher up in the management to talk to someone with an intelligence to understand that when travelling you dont carry your lifes receipts with you, I was shuffled to one connection to another until I reached a man that gave me a number to call that didnt have a person on the end of it.  This is HP at its best.  Sell a product and dont take the time to be there when you need them.  I will stop spending my hard earned money on HP once again.  They have shown thier true business colors once again.  Good bye after a decade of supporting your products.  Not again. Disgruntled and angry at your lack of support.

    Seems that once you purchase an HP product these days and register it online and show the warranty data that HP will not do any warranty work for you unless you produce the sales receipt.  I work internationally and travel the world.  Recently purchased an HP Envy 15 in Los Angelas in April 2012.  It was a fantastic machine till two days ago when it decided to just quit.  Nothing, no indications, no fan, no noise just dead.  I troubleshot the cord, the power, the battery and had IT look at it and it appears to be a motherboard issue.  So I contacted support only to learn that because I dont carry every purchase receipt I have for all products i have purchased in my life and one of them being this Laptop, they refused to work on it even though it is clearly registered and shows that it has a warranty!  Once again HP has let its customers down and put in place a policy that is rediculous and uncalled for to protect themselves from anyone ever using thier service, if that is what they actually have?  I suspect it is just a call center and there is not a repair station and they just use the receipt as an excuse because as I tried to go higher up in the management to talk to someone with an intelligence to understand that when travelling you dont carry your lifes receipts with you, I was shuffled to one connection to another until I reached a man that gave me a number to call that didnt have a person on the end of it.  This is HP at its best.  Sell a product and dont take the time to be there when you need them.  I will stop spending my hard earned money on HP once again.  They have shown thier true business colors once again.  Good bye after a decade of supporting your products.  Not again. Disgruntled and angry at your lack of support.

  • 'Runtime' help under XP

    All I want to be able to do is open up explorer to a specific directory and I can't work out the command.
    I can use;
    Runtime.getRuntime().exec("calc.exe");successfully for example or any other windows exe in any directory in the windows environment
    however;
    Runtime.getRuntime().exec("DivFix.exe", null, new File("D:\\Backup\\Utils\\DivFix")); doesn't work (throws IOException) and I can't see what im doing wrong! And yes, I've checked and double checked the path.
    stacktrace =
    java.io.IOException: CreateProcess: DivFix.exe error=2
         at java.lang.Win32Process.create(Native Method)
         at java.lang.Win32Process.<init>(Win32Process.java:66)
         at java.lang.Runtime.execInternal(Native Method)
    ......rest is just GUI event handling stuff......
    I doubt I'd have to specify a working directory in order to open up an explorer window for example, so the 2nd example code maybe irrelevant regarding the original question but it'd be useful to know for future reference. So I guess im asking two different questions here :/
    tia

    That's most odd, if I use the 'listFiles()' method and loop thru the array it clearly shows it I can see the 2 files in there .exe and .ini - I've tried with a few more different files (checked the same way) and im always better an error 2 in the stack trace....any ideas?

  • Search Help for Vendor Feild not getting populated in the Screen Element

    Hi Everyone,
    In transaction Miro, I get a POP-UP for Invoicing Party i.e. Vendor and Users required a custom search help.
    The Search help for Vendor(LIFNR) is KRED_C and i appended a Z search help under this.
    Now that the search help exists and I can drill down the values too but when i select/choose any value,  that value is not getting populated in Screen feild.
    is there any validation I need to do for this.
    Please suggest me... I checked SDN there are many things but i couldn't figure out wat i need to do and where I need to modify.
    Regards,
    Raj

    Dear Hema,
    Could you please tell me how many internal tables you are using to store the data for display.
    I observerd that you have lt_stock and lt_mat2 declared in the part of the program
    >DATA: lv_stock TYPE lty_stock.
    >DATA: ltmat2 TYPE TABLE OF lty_mat.
    you have displayed above, however you are also using ls_stock and lv_stock .
    >IF p_ztotal = ' '. "line
    >WRITE 18 ls_stock-matnr.
    >WRITE 38 lv_stock-strgr.
    >
    >ELSEIF ztotal = 'S'.                             "subtotal
        >WRITE: 15 ls_stock-nrmit.
        >WRITE 32 lv_stock-dispo.                    
        >WRITE 43 lv_stock-fevor.                      
      >ELSE.                                            "total
        >WRITE: 15 'TOTAL'(016), ls_stock-prgrp.
    >
      >ENDIF.
    Are those for displaying some other information?
    Also the problem of display you are facing can also be because there are no records to be displayed which satisfies the selection criteria.
    Best Regards,
    Rajesh.
    Please reward points if found helpful.

  • Please help me setup us the PPP dialup for OS 8.0

    I have not the ability to conduct my own research, for all my methods have failed and I am stranded with no internet at my home.
    I have the OS 8.0 as my system of operation. My Control Panel doesn't have the PPP option, as many websites have described. I do not know what to do and feel like a helpless baby. Please help, I'm running out of lollertears!
    I just need to know where to enter the access number and user name and password that my ISP has provided me.
    Thank you and may the Rofl of Bethlehem live inside you all.
    The Roflator of Lollerz   Mac OS 8.6 or Earlier   Roflastic

    Michael
    I've checked my old PPC 7600.
    I didn't find PPP either-but found it in the TCO/IP help under
    connecting via modem(I'M using a router in a network,use DHCP server and remote access):
    You have to
    1)configure the modem
    2)Use remote access
    In the help menu for TCP/IP the PPP-Server is mentioned!
    May be you have got the Internet Connection Kit-I used it to get to internet(only remote acess worked!).
    Good luck

  • Hello, I have this problem on updating applications on my iPhone 4s 5.1.1 i dont know if you can help me with. when ever i want to update an application on apple store i get a different user name then mine(slamdance@cracked.by) this user name is not mine

    Hello,
    I have this problem on updating applications on my iPhone 4s 5.1.1 (jail broken) i dont know if you can help me with.
    when ever i want to update an application on apple store i get a different user name then mine([email protected]) this user name is not mine but its always there only on updating my app's.
    thanking you in advance for your kind help.

    Under the Terms of Use of this forum it is prohibited to discuss jail breaking. By jail breaking your iPhone you void any warranty you may have and forfeit any support from this forum.

  • Can someone help with Merging Files

    Why can't I merge folders ike it says in Help under Folder Basics.
    "Merge two folders
    If you have two folders with identical names at two different locations, you can merge them into a single folder. To do so, you must copy (not move) one folder to the location that already contains a folder with the same name. In the dialog that appears, click Merge.
    The Merge option appears only if one of the folders contains items that are not in the other folder. If the folders contain different versions of identically named files, the only options are Stop or Replace."
    yes they are named identically.
    yes they contain some files that are the same and some that are not the same.
    yes some of the same files in each folder are the same versions and some are not the same versions
    Running osx 10.9.2.
    Does having the location on two different Hard Drives make any difference? The help does not mention that being a problem.

    I suspect you may need to do the usual 'keyboard mashing' to make OS X copy (not move) the folders in question.
    Try the usual modifiers, command, alt, ctrl (and combinations of them) as you drag until you get the indication a move will happen. I think alt will do it (that shows a green icon on the dragged file/folder).
    Does this help make it any clearer…
    http://www.switchingtomac.com/tutorials/osx/understanding-replace-replace-merge- os-x-mavericks/
    P.S. copy is the default behavior across different volumes.

Maybe you are looking for

  • Mouse clicks occasionally stop working

    I am currently deploying a Java Swing application, and sometimes the end-user encounters an unusual problem whereby they open the application and mouse clicks have no effect. The mouse movement is still tracked fine, as buttons and menus get highligh

  • How to reverse and reset documents cleared by FB1S

    Hi all, This is the scenario am into: Payment program cleared an open item doc say 19xxx for the vendor and created a clearing document 20xxx and check ABCD was send to vendor. Later found check was to be voided and the document reversed. Instead of

  • To find name for standard smartform of purchase order in Tcode me21n.......

    Please do not offer rewards Hi Abapers,              I had doubt, regarding how to find the name of standard smartform available for purchase order in tcode - ME21N.           After executing ME21N, n print preview i get a form without logo. So i wan

  • Document Library view selection menu missing

    Hi, I am encountering a strange issue with the SP2013 document library web part. I included a screenshot (see link) where you can see that the web part of the doc lib doesn't contain a view selector menu at the right side. This is only available afte

  • SMD Agent

    Hi, I am trying to install SMD agents(711) on EP 7.0 system ,Got below error when trying to lauch the intsaller (sapinst) guiengine: No GUI server connected; waiting for a connection on host xxxxxx, port 21200 to continue with the installation Jan 11