Parametre from html code

Its my first week in applet so i was trying 2 take a parametre from the html code and then 2 take this parametre and put it as a color ex:
<APPLET code="xxxx.class" width=200 height=200 >
<param name ="name1" value="green"/>
and then in the java code i need 2 set this parametre as a color ex:
g.setColor(Color.?);
?= the color in the parametre name
how can i do this ?

The following snippet of code assumes that the permissible values
for the applet parameter "name1" are hexadecimal RGB values.
"0xFF0000" would be red.
"0x00FF00" would be green.
"0x0000FF" would be blue.
String s;
Color c;
// get the applet paramter from the html file
s = getParameter("name1");
try
    int aR, aG, aB; // RGB-Values
    aR = Integer.valueOf(s.substring(2,4),16).intValue();
    aG = Integer.valueOf(s.substring(4,6),16).intValue();
    aB = Integer.valueOf(s.substring(6,8),16).intValue();
    c = new Color(aR, aG, aB);
catch( Exception e )
    c = new Color(0x00, 0xFF, 0x00);
g.setColor(c);

Similar Messages

  • Extract article from HTML code

    Hi,
    I'm trying to build a search engine for an RSS feed. Thing is i'm trying to store every article as a BLOB field in the database. To optimize my search i'll need to extract the article only and nothing else (no unrelated hyperlinks or html code)
    I'm using the HTMLEditoKit of swing to get the html content without the code, but that's not enough. I need to clean the page of things like headers and footers (they affect the search results)

    i already parsed the XML in the RSS...i've got informa ; the problem is the article itself
    Take this article for example: [http://news.bbc.co.uk/2/hi/europe/7572635.stm] , you've got the article, but you've things all around it from link to different articles to headers, footers menus.
    All of this affects the search results dramatically so i just want the article itself.
    that's the greatest challenge.

  • Create a string from HTML code

    Hello to all,
    What i have already create is a web browser integrate into a VI project and from this i can read some values like temperature or humidity. Also i have put a HTML window in order to take this values and to export to a string (for example to check these values from the browser and to be able to see in separate constat). Can you help how to do this with an example??
    Thanks in advance

    Below i have attached the code and the HTML code from the sensor. If you have to recommend anything it will be usefull for me. I have another problem now. If you see in the HTML code you will see that i have three different values to export(temperature, humidity and dewpoint) but all of them have the same regular expression in order to request in my code. Do you know how is it possible to solve this problem because always i take the same temperature value for three of them.
    Thanks in advance
    Attachments:
    TempHumid.vi ‏41 KB
    HTMLcode.jpg ‏68 KB

  • Local information from html code

    I have built an application in which i required the web-sites which are exclusively built for us people.while retrieving the index/home page of web-sites some are in html, some are in jsp and some are in asp.
    so i need a code exclusively in java to know which area those websites belong to.
    can somebody there help me?
    thank you

    i already parsed the XML in the RSS...i've got informa ; the problem is the article itself
    Take this article for example: [http://news.bbc.co.uk/2/hi/europe/7572635.stm] , you've got the article, but you've things all around it from link to different articles to headers, footers menus.
    All of this affects the search results dramatically so i just want the article itself.
    that's the greatest challenge.

  • Generate a thumbnail from HTML by pure Java on Linux without Graphics

    hi - we in a requirement where we have to generate thumbnails from HTML code. The solution must be implemented in pure Java on Linux where there is no graphics support.
    Options tried already are :--
    1. 3rd party websites - rolled out by our client.
    2. Paid products - rolled out by our client
    3. Media Tracker and other java API - no luck as there is no support after HTML 4.0
    4. Using any os dependent native library - rolled out by our client.
    5. Lobo browser - but having troubles like it opens the browser before screenshot is taken, sometimes. Gone through by putting Thread.sleep() in between and saving remote images into a local html file etc. We got some success in there but problem doesn't end here.
    Questions -
    1. In the point # 5 above, our Linux server had graphics support but in code we set the system property java.awt.headless= true before capturing and generating thumbnail. My question is, if we set this property in the code then does it mean 100% that our code will not use any graphics support, if present in the underlying OS?
    2. Is this really possible to generate images in java on Linux where there is no X window/X server installed? Are we just wasting time in order to achieve which is unachievable?
    Any suggestions are most welcome.
    Regards,
    Sanjeev

    Thanks for ur response! Yeah - we tried but requirements are little different. We have HTML that we have to first render. Whatever output comes, we have to take a screenshot. So in order to render the html we have to have a browser first and I believe every OS which is providing browser support is having Graphics capabilities because browser would have frames, windows, toolbars, menubars etc which fall under Graphics.
    The above way is the only way that I know. If there are another way which ofcourse doesn't require graphics support, please let me know.
    So the question basically is - if I follow above mentioned image (like opening browser and capture screenshot) then is it possible on Linux with no graphics support? Actually I read on internet that lobo browser (written in java) supports this kind of feature.

  • Trim filter for iPlanet - whitespace removing from html

    Hi,
    I've just published my Trim Filter NSAPI plugin for Sun One Web Server/iPlanet
    It is a plugin/filter which removes whitespaces from HTML code. Its LGPL and it can be found here: http://www.thrull.com/iplanet/
    Feel free to test it :-)
    BR,
    Igor

    Cool, thanks for sharing it!
    I took a quick look, and I think I spotted a bug in the write filter method:        /* workaround for a bug? in iPlanet, when returning empty content */
            if (!out_size && amount) {
                rv = net_write(layer->lower, NON_EMPTY_STRING, 1);
                out_size = 1;
            } else {
                rv = net_write(layer->lower, (const char *)buffer, out_size);
            return rv;According to the NSAPI Programmer's Guide (http://docs.sun.com/source/817-6252/npgnsapi.html#wp1004627), the write filter method should return the number of bytes consumed on success. It looks like your write filter method is returning the number of bytes written instead. Perhaps that's the reason you needed that work around?

  • Send data from html to flash action script

    Hi,
    I would like my flash to act differently depending on what
    html page it is on. Can I send information from html code to action
    script?

    Hi,
    Yes you can, by using FLASHVARS. Refer the attached code for
    example. Also you can use Javascript setVariable method of Flash
    object to set values in between i.e. after the page has loaded, as
    in case of FLASHVARS these are sent to flash just at the begining
    i.e. once SWF loads. In the attached exmple i've sent 2 variables
    to Flash one is 'username' and other is 'userId', thse will be
    fetched inside flash movie as _root.username and _root.userId.
    Note: I've added flashvars as PARAM and also as an attribute
    for EMBED tag (used by Mozilla, NS etc)
    Hope this helps.
    Thanks,
    Sumeet

  • Need HTML code to call template from an existing web template

    Hi all,
    Can someone help me with a HTML code which can call another web template from a field of a table.
    I have a web template which includes table as web item.The template when executed displays the data of query view in the form of table.One of the field in the table is Europe.Now my requirement is when i click on that field Europe,it should open up another template which is present in the system.
    Please provide me with a HTML code which can do this.
    Regards,
    Suchitra

    Hi all,
    Can someone help me with a HTML code which can call another web template from a field of a table.
    I have a web template which includes table as web item.The template when executed displays the data of query view in the form of table.One of the field in the table is Europe.Now my requirement is when i click on that field Europe,it should open up another template which is present in the system.
    Please provide me with a HTML code which can do this.
    Regards,
    Suchitra

  • Problem in copy and paste html code generated from google adsense

    tell me where can i paste the html code in mozila .
    I am having account in googlemadsense and whenever i try to copy and go to paste in html it dosent work.please reply me.

    Hi Thanks for reply,but my dear freind as I written in my previous mail also that I am having account in google adsense and as per the given instructions only,when i try to paste the html code,which was generated from their adsense adposting , i try to paste that code after opening the html sources box,that code was not accepted.The html source window was slightly blocked.
    And for your information i am not try to paste any other code from any otherwebsite like word press etc
    Waiting for your reply soon.
    Kavitha

  • IWeb hangs (spinning beachball) when I try to paste HTML code from DW-why?

    Can anyone tell me why this might be happening? When I try and paste HTML code from Dreamweaver using Web Widgets. Then the only solution is to Force Quit which means I lose any other work I've already done in iWeb. Anyone else had this problem? Is there a workaround?

    Your last two posts didn't appear in the forum! They came through my email but there is no link.

  • How to read the HTML code from a webpage

    Hi, I want to be able to read the HTML code of a web page
    In order to extract some info from some pages.
    How can I do that?
    is it using cl_http_client ? I played with that class a bit, but wih no sucess to what I need...

    Hi RagnaRock,
    You can use the following form, hope it helps you.
    Regards,
    Ozcan.
    form get_data_from_url using iv_url type clike changing iv_data type string.
    DATA: HTTP_CLIENT TYPE REF TO IF_HTTP_CLIENT .
      clear  iv_data.
      CALL METHOD CL_HTTP_CLIENT=>CREATE_BY_URL
           EXPORTING
            URL                = IV_URL
    *          PROXY_HOST         = '10.1.1.1'
    *          PROXY_SERVICE      = '1234'
    *       SSL_ID             =
           IMPORTING
             CLIENT             = HTTP_CLIENT
           EXCEPTIONS
             ARGUMENT_NOT_FOUND = 1
             PLUGIN_NOT_ACTIVE  = 2
             INTERNAL_ERROR     = 3
             OTHERS             = 4.
      CHECK SY-SUBRC = 0.
      CALL METHOD HTTP_CLIENT->SEND
        EXCEPTIONS
          HTTP_COMMUNICATION_FAILURE = 1
          HTTP_INVALID_STATE         = 2.
      CHECK SY-SUBRC = 0.
      CALL METHOD HTTP_CLIENT->RECEIVE
        EXCEPTIONS
          HTTP_COMMUNICATION_FAILURE = 1
          HTTP_INVALID_STATE         = 2
          HTTP_PROCESSING_FAILED     = 3.
      CHECK SY-SUBRC = 0.
      iv_data = HTTP_CLIENT->RESPONSE->GET_CDATA( ).
    endform.                    "get_data_from_url
    Edited by: Ozcan Gurdal on Aug 11, 2010 4:07 PM

  • How to use h:message to display HTML code in message from property file

    I am using <h:message for="somecomponentid"/> to display the error message for a validator attached to a component and the error message which resides in message property file contains HTML elements like <br> and
    The HTML doesnt get displayed properly and the code <br> etc is displayed instead.
    Is there a method to get h:message to display HTML elements correcly.
    [I know there is an h:outputFormat which has an escape parameter to allow HTML to be rendered correcly but it has no for parameter to specify the component id whose validation error message I want to display]
    eg.
    <h:message for="somecomponentid"/>
    to display from errormessages.properties
    com.somecompany.thevalidationerrormessage=You have an error<br> Please click here to return to homepage

    Hello Ivan,
    Fortunately I have just recently found a solution to my problem by using code by a developer who had already had this problem in the past and who provided a patch on the Apache MyFaces jira site.
    See following link for the solution I downloaded and then used :
    http://issues.apache.org/jira/browse/MYFACES-155
    I believe they are intending to eventually release this in a future release of MyFaces extensions on this site.
    I used the escape attribute on the tag to allow 'escaped' html code in error messages to be used.
    Hope it solves your problem too..
    Suhel

  • Is it possible to export the html code from a muse site that I am building?

    Is it possible to export the html code from a muse site that I am building?

    Mac_Heibu has the right idea. When you export your site to HTML, it creates a folder that contains all of your pages. Here's an example of what the folder will contain. All of your HTML pages, all your scripts, CSS, and it'll also have individual folders WITHIN your main folder for your phone or tablet versions, if applicable. This method allows you to upload your files to an FTP host. However, if you're trying to upload it to an FTP, the BETTER option would be to go File > Upload to FTP Host. If this has helped you, please mark mac_heibu's answer as the Correct Answer, and feel free to mark my reply as a Helpful Answer.

  • IWeb routing back from html snippet code

    I have created my site in my local folder (sites/site). In the site I use a HTML snippet in which I pasted HTML code from JotForm in order to have a contact form. This worked fine. Then I published to web.me.com... and now every time I hit the submit button (HTML code) the routine runs perfect and an email is submitted to me but I don't come back to the site but get an error code: The requested URL /users/maartenlamers/sites/site/startpage.html was not found on this server. It seems that the routing pointer is set wrong... and I found no way of correcting this... Any suggestions are welcome...

    I believe that JotForm allows you to get your visitors to return to a page of your site do they not? If so, then to correct this you need to go back to JotForm and alter the settings there. You created the form there, so you need to make alterations there. It's not an iWeb issue - all you did was enter the code into an html snippet.
    Also, your url is not a correct url so of course it won't be found. Any url needs to start with http://web.me.com/users/maartenlamers/sites/site/startpage.html. If you leave out the web.me.com, then it won't find anything that is published because you have in fact missed out where the site is published, being web.me.com.
    Go back to JotForm and alter it there and then re-enter the code into an html snippet and you should find that it will work.

  • I want to upload HTML code from an existing site and then revise in Muse. Is this possible?

    I want to upload HTML code from an existing site and then revise in Muse. Is this possible?

    HTML files from an existing site cannot be reused in Muse as Muse works only with files having extension as .muse.
    However, you use apps like Dreamweaver to edit your existing HTML files.

Maybe you are looking for

  • A pop up window comes up when I click on safari but I can't close out of it nor can I continue access to safari...how can I fix this?

    A pop up window opens when I try to open safari, however, I can't exit out of it, nor can I continue using safari.  How can I fix this? (the iMac was purchased summer 2011 and all updates done).  Thanks.

  • Problem in working with Japanese data

    Hello, We have an application, which should work for both English and Japanese languages. Our application is working fine for English data but in case of Japanese, we are facing problems. In the application, there is a language setting, where the use

  • Webdynpro iveiws gets displayed only half the of Content Area with scroll

    Dear Experts, We are running on EP 7.0 SP13 and I have some webdynpro Iviews. Now when i'm in default framework page-desktop i'm getting the normal full screen view of the WD iview screen. But when i use lightframework page-desktop, the content area

  • A problem with Security settings.

    Good afternoon. We have just set up a new 802.11n Base Station to compliment our eight other Base Stations. These eight are an older version running V 5.7 of the software. Security on the older ones is set at WEP 128 bit and I need to set it at the s

  • Solaris 8 02/02 Scrolling

    We have an application that provides a circuit diagram window that is scrollable. We have a diagram that is large and has many crossing lines. This app works fine with Solaris 8 10/01on our Sun Blade 100. When we install Solaris 8 02/02, scrolling th