Puting into JEditorPane HTML file

I want to put into JEditorPane HTML file from my local drive.
How to do that?

Hear is example try it.
*(c)pesilEX - 2007
* [email protected]
* Let�s make a open source software world
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.net.URL;
public class pesilEX extends JFrame implements ActionListener{
JPanel cp;
// Declaring a url to get file name
// Also this can use to get url form online
public URL helpURL;
JScrollPane scrol;
JEditorPane htmlPane;
JButton btn1;
// This string is use to store file name
String fileName;
public pesilEX(){
     cp = (JPanel)getContentPane();
     cp.setLayout(null);
htmlPane = new JEditorPane();
htmlPane.setEditable(false);
scrol = new JScrollPane();
scrol.getViewport().add(htmlPane);
scrol.setBounds(10,10,370,300);
cp.add(scrol);
btn1 = new JButton("View!");
btn1.setBounds(260,320,120,20);
cp.add(btn1);
btn1.addActionListener(this);
public void actionPerformed(ActionEvent e){
     if(e.getSource()==btn1){
     // File name you can replace is as you want
fileName = "pesilEX/help.htm";
// Import html file to java
     helpURL = getClass().getClassLoader().getResource(fileName);
try{
// Set url to JEditorPane
     htmlPane.setPage(helpURL);
catch(Exception er){
     System.out.println(er.toString());
public static void main(String[] args){
pesilEX pesil = new pesilEX();
          pesil.setSize(400,400);
          pesil.setTitle("pesilEX JHtml viewer");
          pesil.setResizable(false);
          pesil.setVisible(true);
}

Similar Messages

  • How to combine 3 HTML files into 1 HTML file?

    I'm designing a few layouts for my website recently, and have faced several problem. One of those is regarding "HTML coding", I usually upload files from Photoshop to Dreamweaver and it will automatically help me to generate the HTML code. I wanted to upload my own HTML layout design for my personal blogspot. But I realise that blogspot only allow 1 HTML code for the entire website design and when I did my web design in Dreamweaver (my website consists of HOME, ABOUT, CONTACT pages), it has a total of 3 HTML code for different pages and I couldn't upload it to my blogspot. So I would like to ask how can I actually do to combine all 3 HTML codes into 1 HTML code. Thank you.

    Hi Nancy, I would like to ask you if I'm using Illustrator CS6 instead of Photoshop? After I slice the vector file, I save as web devices > PNG file. But I realise that Ai and Psd do not work as the same, in Ai, it could not save as HTML. So what should I do after slicing images in Ai? :-D
    Another issue I'm facing is that do I have to create <div class> and <div box> to combine all the HTML files together into 1 and upload to blogspot? (1 long HTML that consists of HOME, ABOUT, CONTACT pages). Thank you

  • How do I save input from a user into a html file?

    Sure could use a couple of pointers here, I am a newbie to jsp's. I am trying to create an html file with meta tag keywords and description for search indexing purposes, the idea is to have the user call a jsp page and enter the desired meta tags in a form then save this info in html format so the Spider can index it at a later time. Not sure of the most efficient way to do this. Any help/ideas would be greatly appreciated. Thanks in advance.

    Hi,
    I would like to take Meta keywords and descriptions from a form entered by the user and generate an html page with the keywords and descriptions in the proper tags. This html page must be saved on the server so our Spider can index it. The idea is to increase the results for a webpage by indexing an html page with proper meta tags defined and redirect the searcher to the desired page. I'm not sure how to create an html file to be saved on the server, not displayed in the originating browser. Thanks

  • Convert an xml file into separate html files

    hi,
    i've a problem. i have an xml database. i want to create an html file from that database. but the condition is ,after reading a specified number of nodes say(100) it must write the rest in a new html file. how could i do this.
    please help.

    DOM in explorer or java dom will help u i n that

  • How to save html code  into a html file in webdynpro

    Hello Everyone!
    I want create a html page in WebDynpro,
    example :
    String mystr = "<html><head><titile>This is a text</title></head><body> this is body</body></html>";
    I want create a html page and save this to the *.html page , how can i to do ?
    thanks!

    HI! sowmya&Satya
    1st:
    I use method (File>new>file.) create a html under my project . but when I swith web dynpro perspective,  can't found the html file under my current project ?
    2nd:
      public void onActionInputToHtml(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionInputToHtml(ServerEvent)
        String mystr = "<html>.............</html>"
        //@@end
    how to input "mystr" to the html page which I have create in 1st step ?
    3rd :
    how to display the html page In IE when run my project program ?
    Thanks!

  • How do i convert a pdf file into a html file?

    need help with question

    Hi Wolfie1234,
    You can use Acrobat 11 to convert a pdf to html.
    Launch Acrobat. Click on File > Save as Other > HTML Web Page

  • How to export spool file into HTML file

    Hi,
    I have one Oracle procedure which meets our business requirement. I am keeping the output data into a log file and I am sharing that log file to the users.
    Sample Code:
    spool path\logile.log
    declare
    begin
    dbms_output.Put_line('output will come here');
    end;
    Now I want to spool the same output data into a HTML file and need to share with the users.
    Can any one please guide me, how to export our spool data into HTML format?
    Thanks in advance.

    Hello 909127,
    welcome to the forum.
    This is the forum for the tool Oracle Reports, not a general forum for reporting. Your question might be better posted in {forum:id=75} or {forum:id=144}.
    Nevertheless you need to give us more information, how your output looks like now and what you expect in HTML.
    Regards
    Marcus

  • Loading different banners into html file depending on screen width? (Responsive)

    I have a html file that has my banner in it. I call my banner into the html file with this script in the head section: <script type="text/javascript" charset="utf-8" src="banner_edgePreload.js"></script>
    I also have a second banner called banner2. So all I have to do to switch the banners in my html file is put a 2 after the word banner in the script above ^ because they use the same resources.
    Now im trying to get it to change from banner to banner2 when screen width is 1200 or less.
    I was using this code but it doesn't seem to be working:
    <script type="text/javascript" charset="utf-8" src="banner_edgePreload.js"></script>
    <script type="text/javascript" charset="utf-8" media="screen and (max-device-width: 1200px)" src="banner2_edgePreload.js"></script>
    Any ideas on how I can get this to work?
    Thanks!

    Not sure if this is what you are looking for
    Different Banners (and sizes) for different pages? - Squarespace Answers

  • How to read data from a excel and HTML file

    Hi
        I am writing an 2D-array of string into Excel/HTML file using Report generation.
        Can anybody tell me how to retrieve back the written data from the same files again and view in array format.
    Thanks & regards
    Visuman 
    Solved!
    Go to Solution.

    you can use activex to read the data from the excel fileback in the array format...go through this vi...may b this will help you.........
    Attachments:
    Read Excel-1.vi ‏32 KB

  • Problem in converting word to html- file get error msg 'This command is not available because no document is open'

    Hi,
    I write the some asp code to save the word file from client machine to server machine , and convert it into the html file.
    it working fine when i debug the code into the visual studio but when i deploy code on iis it give me a error 'This command is not available because no document is open' , while i try to save file into html format.
    lot of time i try this give all the security full access to iis user and other things .
    can any one help me. i fully frustrated from this problem. 
    my need only upload the word document from client to server machine and convert it into the word document. 
    only IIS give me the problem, suggest me what setting i need to do in iis 
    please help me humble request 

    Hi,
    In this forum we mainly discuss questions about Office client questions and feedbacks, issues related to coding are not supported here.
    Based on the description, although the question is about converting Word documents, it's more likely to be a permission issue, the question is better to be posted in the IIS.NET forum:
    http://forums.iis.net/
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Regards,
    Melon Chen
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs. Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How can i include css in html file when exported

    I want the CSS should be included in the html file when exported, how is that posable?

    Muse follows its own structure and keeps HTML, CSS and JS code in separate files as and when possible. If you want all that code to be merged into the HTML file itself, then there is no option to force Muse to do that. You can however, add your own CSS code into the HTML page by adding the CSS using either the Insert HTML option or using the HTML for <head> option in Page Properties > Metadata.
    Cheers,
    Vikas

  • A helloworld java applet that will work on an html file

    I have spent a lot of time trying to get a java applet to work on a web page. Of course, I can download zip packages and they will work. But I can?t seem to find a formula for creating something simple that will work.
    All the examples that I have found will either work on Windows when running it on the command line, or work in Netbeans, but none of them will work when I put time into an html file on a linux web server.
    Can someone post, maybe the simplest code that will output ?Hello world? on a Linux Apache Web server.
    I have the gist for creating and programming java? as least a basic start. But I?m anxious to see an example that I can compile that will actually display on an html file and not just my Windows programming environment.
    Thanks in advance for any feedback on this.
    -- L. James
    L. D. James
    [email protected]
    www.apollo3.com/~ljames

    AndrewThompson64 wrote:
    apollothethird wrote:
    I have spent a lot of time trying to get a java applet to work on a web page. Of course, I can download zip packages and they will work.Does that somehow relate to this problem? What exactly does a Zip 'package' do when it 'works'?It displays the text on the web page.
    >
    .. But I can&#146;t seem to find a formula for creating something simple that will work.
    All the examples that I have found will either work on Windows when running it on the command line, or work in Netbeans, but none of them will work when I put time into an html file on a linux web server.
    Can someone post, maybe the simplest code that will output &#147;Hello world&#148; on a Linux Apache Web server.
    Is that a question? Please make sure to add a question mark.
    // <applet code='HelloWorldApplet' width='400' height='300'></applet>
    import javax.swing.*;
    public class HelloWorldApplet extends JApplet {
    public void init() {
    add(new JLabel("Hello World!"));
    validate();
    I have the gist for creating and programming java&#133; as least a basic start. ... Applets are not for newbies. Leave them alone for at least another 6 months.Thanks, Andrew. The lines of text you provided were very enlightening. I was able to do a lot of dissecting and experimenting and have the full gist of my question answered. I don?t have any problems outputting either text on the console or text on browsers.
    -- L. James
    L. D. James

  • View metadata near his image in a html file?

    Hi
    I am new to this board,
    I wanted to ask if there is a way to publish the metadata of an image, (or filtered metadata), into a html file, (for expample near the image).
    It want to publish photos with some of the metadata of it made readable on an easy way...
    Thank you in advance for looking at my problem
    Erwin

    Within Bridge you can select a batch of images and convert them to a Photoshop Web Photo Gallery.
    You can customize the page templates that Photoshop uses. I've not seen any documentation for metadata but some of the templates display caption, copyright, etc. Try searching or asking on the Photoshop forum.

  • How to import password html file in Firefox in win7 -

    I exported password into a HTML file from firefox on a PC with XP-SP3. I can't find where to import these into firefox on my new Win7 PC.

    Firefox doesn't export passwords, nor does it use the HTML format for password files. Did you use a Firefox extension to export your passwords? If so, install that extension in your new installation and use that extension to import your password backup.
    Also, if you still have your Profile from that other PC, see this.
    http://support.mozilla.com/en-US/kb/Recovering+important+data+from+an+old+profile

  • Parsing the URL of all images from Google Images html file

    Hello all,
    I am trying to pull all the image URL's from a html file. I have used URLConnection class to copy the follwing link
    http://images.google.com/images?q=tiger&gbv=2&svnum=10&hl=en&start=21&sa=N&ndsp=21
    into a html file in my local drive. Now this file has the URL's of the images that have been displayed by google images (searched for: tiger). Now I need to fetch up those image URL's.
    any ideas???

    Thank you for the reply.
    I am beginner. Can you please eloborate the explanation or do u have some code examples.
    thank you very much

Maybe you are looking for

  • Want to create Document new version with BAPI_DOCUMENT_create2

    Hi, I want to create a document with new version with the help of existing document in DMS. In my development of module pool i can add new file and also i can create new version of existing document. all this i can do from my Z-development. When on i

  • [resolved] Cannot access particular site

    I cannot access http://www.philosophypages.com. I tested using the "is it down or is it me?" site and apparently, it is "just me". I can ping the site fine. But if I try to view the page in firefox, it hangs forever. I don't see any complaints in the

  • RetriggeredPulse Train Generation PCI-660x

    I am generating a retriggered pulse train using the PCI-6602. I can generate it fine, but when I exit the user interface (created with labwindows/cvi 7.0) it stops the wave output. Is there any way to keep the output going after exiting?

  • User language according to browser settings

    Hi all,I saw that is possible to display the guest page according to the browser language. This is done by leaving blank the <International><Locale> attribute in j_config.xml. If I want to use this mechanism for all the portal users, do you know what

  • Itunes has encountered and error message

    I have downloaded the quick time player and it is operating but I still am having trouble with Itunes error message and I can find the itunes standalone to download this is my mistake most likely but i need help