JEditor Pane can shows HTML, and in AWT?

Hello,
I need to show a web page in a Frame, with hyperlinks. I have found that this is possible, and very easy in Swing, with a JEditorPane, but can I do this in AWT?
Thank you.

These are all in javax.swing.text or javax.swing.text.html packages, but an EditorKit extends to Object not to Component, JComponent, Container...
Then these will not decrease speed. However, these could use a swing class :( but i don't think.
If you see sources, they import java.awt or javax.swing.text.* but not javax.swing.*
( I didn't verify all class, then be careful )

Similar Messages

  • My trash can shows empty and other issues with it...

    Ok basically, if i delete anything on my mac it should go to my trash can right?
    Well i have a few problems with that as follows:
    1. Everytime i delete something or move something to the trash it asks me to enter my password everytime, then deletes it, this never used to happen and now all of a sudden it does, this started just before the latest lion update and ive tried everything i know to stop it doing it but failed.
    2. When i do delete something, the trash can shows empty on my desktop, and when i open the trash there is nothing inside, so im not able to restore anything if required, so basically if i move anything to trash it just gets permanently deleted instead of storing it in trash first, again this started just before the latest lion update.
    I was hoping the update would fix this issue but didnt change it what so ever, i have also tried repairing disk permissions and still no change.
    Any ideas on what i can do to fix these problems? Im still new to mac so i dont know all the ins and outs, but any help on this would be appreciated.
    Cheers all,
    Carl

    Boot from your recovery partition by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.
    When the recovery desktop appears, select Utilities ▹ Terminal from the menu bar.
    In the Terminal window, enter “resetpassword” (without the quotes) and press return. A Reset Password window opens.
    Select your boot volume if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select  ▹ Restart from the menu bar.

  • JEditor pane not showing images

    the following piece of code displays a directory and the link displays all the files ,if it is an image it shows the preview but actually i am not getting the image ,can any one help me?
    thanks
    code:
    import javax.swing.*;
    import javax.swing.event.*;
    import java.io.*;
    import java.util.Date;
    * This class implements a simple directory browser using the HTML
    * display capabilities of the JEditorPane component.
    public class FileTableHTML {
      public static void main(String[] args) throws IOException {
        // Get the name of the directory to display
        String dirname = (args.length>0)?args[0]:"C://Documents and Settings//400305//My Documents//SyncIT";
        // Create something to display it in.
        final JEditorPane editor = new JEditorPane();
        editor.setEditable(false);               // we're browsing not editing
        editor.setContentType("text/html");      // must specify HTML text
        editor.setText(makeHTMLTable(dirname));  // specify the text to display
        // Set up the JEditorPane to handle clicks on hyperlinks
        editor.addHyperlinkListener(new HyperlinkListener() {
          public void hyperlinkUpdate(HyperlinkEvent e) {
         // Handle clicks; ignore mouseovers and other link-related events
         if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
           // Get the HREF of the link and display it.
           editor.setText(makeHTMLTable(e.getDescription()));
        // Put the JEditorPane in a scrolling window and display it.
        JFrame frame = new JFrame("FileTableHTML");
        frame.getContentPane().add(new JScrollPane(editor));
        frame.setSize(650, 500);
        frame.setVisible(true);
      // This method returns an HTML table representing the specified directory
      public static String makeHTMLTable(String dirname) {
        // Look up the contents of the directory
        File dir = new File(dirname);
        String[] entries = dir.list();
        // Set up an output stream we can print the table to.
        // This is easier than concatenating strings all the time.
        StringWriter sout = new StringWriter();
        PrintWriter out = new PrintWriter(sout);
        // Print the directory name as the page title
        out.println("<H1>" + dirname + "</H1>");
        // Print an "up" link, unless we're already at the root
        String parent ="C://Documents and Settings//400305//My Documents//SyncIT";
        if ((parent != null) && (parent.length() > 0))
          out.println("<A HREF=\"" + parent + "\">Up to parent directory</A><P>");
        // Print out the table
        out.print("<TABLE BORDER=1  WIDTH=600 height=500><TR>");
        out.print("<TH>Name</TH><TH>Size</TH><TH>Modified</TH>");
        out.println("<TH>Readable?</TH><TH>Writable?</TH></TR>");
        for(int i=0; i < entries.length; i++) {
          File f = new File(dir, entries);
    out.println("<TR><TD>" +
              (f.isDirectory() ?
                        "<a href=\""+f+"\">" + entries[i] + "</a>" : "<img src=\""+f+"\">"+
              entries[i]) +
              "</TD><TD>" + f.length() +
              "</TD><TD>" + new Date(f.lastModified()) +
              "</TD><TD align=center>" + (f.canRead()?"x":" ") +
              "</TD><TD align=center>" + (f.canWrite()?"x":" ") +
              "</TD><br><br><br><br><br></TR>");
    System.out.println("<TR><TD>" +
              (f.isDirectory() ?
                        "<a href=\""+f+"\">" + entries[i] + "</a>" : "<img src=\""+f+"\" align=left width=30 height=30 border=0>"+
              entries[i]) +
              "</TD><TD>" + f.length() +
              "</TD><TD>" + new Date(f.lastModified()) +
              "</TD><TD align=center>" + (f.canRead()?"x":" ") +
              "</TD><TD align=center>" + (f.canWrite()?"x":" ") +
              "</TD><br><br><br><br><br></TR>");
    //System.out.println("<img src=\""+f.toString()+"\""+" align=left width=30 height=30 border=0"+">");
    out.println("</TABLE>");
    out.close();
    // Get the string of HTML from the StringWriter and return it.
    return sout.toString();

    just work on getting one simple image to .jar OK
    e.g. this should .jar OK (after changing image names)
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class Testing
      Image img;
      public void buildGUI()
        try
          java.net.URL url = new java.net.URL(getClass().getResource("Test.gif"), "Test.gif");
          if(url != null) img = javax.imageio.ImageIO.read(url);
        catch(Exception e){}//swallow exception - handled in paintComponent
        JPanel p = new JPanel(){
          public void paintComponent(Graphics g){
            super.paintComponent(g);
            if(img != null) g.drawImage(img,100,100,this);
            else g.drawString("this space for rent",100,100);
        JFrame f = new JFrame();
        f.getContentPane().add(p);
        f.setSize(400,300);
        f.setLocationRelativeTo(null);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
      public static void main(String[] args)
        SwingUtilities.invokeLater(new Runnable(){
          public void run(){
            new Testing().buildGUI();
    }put the image in the same folder, make .jar, then try the .jar on another pc
    if all OK, change code to locate image file in subfolder, make .jar, then try the .jar on another pc
    if all OK now, modify main program accordingly.
    note: in .jars, capitalization of the image file names counts
    e.g. in my above example, if I change Test.gif to test.gif, the image is not drawn

  • Can I store and retrieve .html documents to iPad memory card?

    I have not purchased an iPad yet. I am trying to see if it will fit my business needs.
    I want to use the iPad for business, so that I can demo web sites that I build, to potential customers. I know, I won't always been in range of a wireless signal. Can I store the .HTML files to the memory card, so that I can call them up and browse them using Safari, where they could be accessed and look the same as if I was accessing the web real-time?
    I also own an iMac.

    The simple answer is maybe. The iPad natively reads HTML files that are email attachments. Thorough Good Reader you can read HTML and safari web archive files.
    The problems is going to be in displaying images that are online if you're not connected. There are some site builder apps for the iPad. You can search "HTML" in the apps store. Look carefully. Most offer a safari prieview but might not store images locally.
    A possible option is an app like Offline Pages (Freeware) that can store full pages and images for offline browsing.

  • Show HTML in Personal Profile?

    i'd like to show HTML (from a file or from a string) in any kind of component in an app running on a PDA. Probably i will use Personal Profile (and WSDD).
    Are there any components I could use to show HTML. Maybe in AWT?
    I know there are components like that in swing, but I don't know if I can use swing on a PDA??

    hi slomoman,
    i am also interested in the answer. Here is my research:
    You can show HTML in swing components like JEditorPane, But not in AWT.
    Also I could not find a way, how to run swing app with WSDD on PDA.
    good luck
    -fatbrain73

  • Show HTML

    are there any components to show HTML in a java awt application? can I load that HTML from a local file or from a URL?

    The JEditorPane can show HTML or Rich Text :
    public JEditorPane()
    public JEditorPane(String type,String text)
    public JEditorPane(String url)
    public JEditorPane(URL initialPage)
    Hope that was of help.

  • Showing pdf and office files in 5230.

    hi everyone,
    i'm searching to free application(s) that can show pdf and office files. can someone help me? i have 5230.
    thank you.

    @efitac
    As for .pdf you could have a look at AlternateReader here:http://sourceforge.net/projects/alternatedjvu/
    Happy to have helped forum with a Support Ratio = 42.5

  • When calling report from forms, only html format report can show chinese characters

    To all experts,
    When I run report by calling run_report_object() in forms, only html format can show chinese characters. If I choose pdf format, garbage characters were shown instead of chinese characters. My settings on server are as follows:
    NLS_LANG=TRADITIONAL CHINESE_HONG KONG.UTF8
    FORMS60_REPFORMAT=PDF
    Do you know why? I hope to print report in PDF format as PDF turned out to be more regular in format. Is there any additional settings required?
    May experts here broaden my mind?
    Richard

    You have two different ways of generating Japanese PDF files from Reoprts. One is font aliasing and the other is font subsetting.
    <font aliasing>
    You will need to have the following entries in uiprint.txt (example).
    [ PDF ]
    .....JA16SJIS = "KozMinPro-Regular-Acro"
    "MS UI Gothic".....JA16SJIS = "KozMinPro-Regular-Acro"
    You may need to download and install Japanese Font Pack from Adobe's web site (if your Acrobat is non-Japanese version).
    <font subsetting>
    You will need to add C:\WINNT\Fonts (or wherever your TTF/TTC fonts are installed) to your REPORTS_PATH.
    You will also need to have the following entries in uiprint.txt (example).
    [ PDF:Subset ]
    "Andale Duospace WT J" = "Aduoj.ttf"
    "Albany WT J"="AlbanWTJ.ttf"
    "MS UI Gothic" = "msgothic.ttc"

  • JEditor pane does not  show applets

    HOW TO SET THE CONTENT TYPE OF THE EDITOR SO THAT IT CAN OPEN ALL
    INCLUDING APPLICATIONS AND GRAPHICS,
    IT OPENS RTF'S, HTML AND TEXT AND FILE LIST, AND EVEN WHEN SET TO IMAGE/GIF IT DOES NOT OPEN THAM

    that's true, applets are not displayed...
    Text, RTF and HTML files are displayed because the Editor Pane uses a specific 'Document' (i I remember well) to open them. To be able to display other kind of information, you could need to create your own Documents...
    vincent

  • Hi:  When I open my iPhoto the popup shows up and I don't know how to correct it.  Here is the popup "The current screen resolution is not optimal for iPhoto?" Can you help

    When I open my iPhoto a popup shows up and I don't know how to correct it the popup:
    "The current screen resoulation is not optimal for iPhotp"?
    Can you help?

    Go to the System/Accesability preference pane and enable the Zoom capability either with keystrokes or Magic Mouse:
    See if that will work for you.
    OT

  • I have songs on my iPhone 6 that I can't remove and when I plug into iTunes and go to "Summary" and "On This Device" the songs don't show up but they are on my phone. How do I remove them? Not even sure how they got on actually.

    I have songs on my iPhone 6 that I can't remove and when I plug into iTunes and go to "Summary" and "On This Device" the songs don't show up but they are on my phone. How do I remove them? Not even sure how they got on actually since I have a iTouch and keep all my music there. HELP!!

    Have you tried deleting the songs from Settings?
    Settings -> General -> Usage -> Manage Storage (not the iCloud link!) -> Music and then click Edit to enable you to be able to delete.

  • I set up my iCloud account on iPad with an exchange account and aol account.  I can see exchange and aol emails but not those from .me account or apple email.  I got it to show all 3 accounts on my iPhone with no problem.  Hat am I missing?

    I set up my iCloud account on iPad with an exchange account and aol account.  I can see exchange and aol emails but not those from .me account or apple email.  I got it to show all 3 accounts on my iPhone with no problem.  Hat am I missing?

    I'm having a similar problem, but I do have the key and is not working anyway.
    My old pc was running on windows 7 and my new one is an apple running on Lion.
    My phone is an Iphone IV and I can see all the bookmarks there.
    In order to sync, what I did was click on the "I don't have the device with me", I entered the key that was provided and the process finish ok. It says congratulations, etc, etc.
    But the bookmarks are not there, I tried merging data and replacing data on this computer options but is the same.
    Any suggestions?

  • I have the apple univeral dock and AV cables and   can play videos and slide shows on my TV but not music How do I play the music

    I am trying to connect an IPOD classic to my TV to play music
    I have the dock and AV cables and can play videos and slide shows but not music

    Actually, i figured part of it out. When I'm playing itunes to my Apple Tv and Airport Express stations around the house, then turn on the mirroring, the itunes volume bar goes all the way to zero. I can bring it back up manually, and it will play on Apple TV, but it won't broadcast to multiple Airport Express speakers, the way it was doing before I turned on mirroring. It seems that mirroring turns off the airport express stations.

  • I got the new iPhone 5C. In my cellular settings, under "Use cellular data for", it only show passbook and facetime. How can I add other apps? Also, my carrier is AT&T

    I got the new iPhone 5C. In my cellular settings, under "Use cellular data for", it only show passbook and facetime. How can I add other apps? Also, my carrier is AT&amp;T

    Hello Sophie59
    You should be able to see two different tabs when setting up the email if you go to Other > Add Mail Account. Once you enter in the email address and password, you should be at the next screen to provide more details about the email as far as incoming and outgoing servers and at the top there will be a blue section to add it in as a POP or IMAP email account. Check out the article below for further troubleshooting and emails setup options.
    iOS: Troubleshooting Mail
    http://support.apple.com/kb/ts3899
    iOS: Adding an email account
    http://support.apple.com/kb/ht4810
    Regards,
    -Norm G.

  • How can i create a simple netweaver portal page that shows text and images?

    Hi,
    i have a simple question or maybe it's not so simple.
    I am completly new to SAP Netweaver 2004s Portal. At the moment i'm trying to understand the struture of the whole thing. I already know how to create roles, worksets and pages and i know how to combine the different elements so a user can acces them.
    And now i want to create a simple portal page that shows text and images. Is it possible to create such a simple page with the portal content studio? What iView do i have to use?
    (I just want to create a start page with a welcome text on it.)

    Marc
    Considering that you would any ways go ahead with complex development from this simple start page I recommend create a Web dynpro Iview for your start page (include the Iview in your page).
    For putting the contents use Netweaver Developer studio to build a simple start page application and put your static text on that Iview.
    Please go through the following log after your NWDS development is over - This will make you comfortable for further challenging work.
    http://help.sap.com/saphelp_erp2005/helpdata/en/b7/ca934257a5c96ae10000000a155106/frameset.htm
    Do reward points if this helps and let me know of you want anything more.

Maybe you are looking for