Noob question about implementing JSObject

I'm trying to create an applet that can interact with the javascript on an HTML page and I am at Step 1 and getting errors. I have looked at for answers on this but found no solution. I'm just trying to compile this to see if I can call the f() function in javascript.
My first error is "Package netscape.javascript does not exist"
Second is "cannot resolve symbol : variable JSObject
it just goes from there...
Below is my code. Does anyone have guidance. This is my first applet.
import netscape.javascript.*;
import java.awt.*;
import java.applet.*;
import javax.swing.*;
public class asplp extends JApplet {
    static final String message = "Hello World!";
    private Font font = new Font("serif", Font.ITALIC + Font.BOLD, 36);
    public void init() {
        // set the default look and feel
        String laf = UIManager.getSystemLookAndFeelClassName();
          JSObject win = JSObject.getWindow(this);
          JSObject doc = (JSObject) win.getMember("document");
        JSObject loc = (JSObject) doc.getMember("location");
        String s = (String) loc.getMember("href");  // document.location.href
        win.call("f", null);                        // Call f() in HTML page
          try {
            UIManager.setLookAndFeel(laf);
        } catch (UnsupportedLookAndFeelException exc) {
            System.err.println ("Warning: UnsupportedLookAndFeel: " + laf);
        } catch (Exception exc) {
            System.err.println ("Error loading " + laf + ": " + exc);
            getContentPane().setLayout (null);
    public void paint (Graphics g) {
        super.paint(g);
        g.setColor(Color.blue);
        g.setFont(font);
        g.drawString(message, 40, 80);

The problem really is that there is no distribution for this Jar.... The classes are found in several places, but where they'd be on a Mac, I don't know... They don't come with Java, they come with the browser.
Of course, one solution I've seen is to use reflection to get a JSObject and it's methods... it's a bit more code, but it doesn't require having the actual classes to build.
What I did to get my copy of these classes is to find them in the Netscape 4.7 installation's files and pull the netscape.javascript classes out to make a little Jar that I use for development purposes. It's just the classes needed to compile them... I would post that Jar here except that I'm really unsure of any legal issues regarding doing that...
But if you can get a copy of Netscape 4.7... You could do a search for files containing "JSObject" and you'd find a jar or zip file there.

Similar Messages

  • 2 noob questions about speaker settin

    . What if I don't sync the Creative speaker settings with windows control panel speaker settings?
    2. What if I the speaker settings(both Creative and windows) don't match my speaker type?For example, I have only headphone connected to my Audigy 2 ZS but I set the speaker setting to 5. or whatever else. Will this improve my sound quality in games such as Battlefield 2? Am I?supposed to get the virtual 5. surround sound effect? Because I've heard that cmss upmixes stereo sound in?games to virtual 5. or 7. surround sound for headphones.
    Thanks.
    Message Edited by jermin on 06-24-2008 02:09 PM

    Re: 2 noob questions about speaker settings?slightlys I have a slightly different set up.
    I have 5. speakers that I use for movies and some games. For BF242 I use headphones because they give you an advantage as you can hear people creeping up behind. The virtual surround sound is really good with my XFi xtremeMusic.
    First I don't think it matters what you select under Windows Control Panel as the Creative Console Launcher updates speaker settings in Windows. Second if you want virtual 3d with CMSS on headphones just select headphones and enable CMSS3D. Then click the 'headphone' button on the CMSS3D tab and you can test the sound - a helicopter pans around in 360 degrees.
    Then in games set the software to output 5. - AFAIK. Battlefield seems to do this automatically but I can't speak for other games. I'm assuming the Audigy has the same CMSS3D tech that the XFi has.

  • Noob question about launching apps

    Greetings all,
    Just made the switch to a Powerbook with OS X Tiger, and have a question about launching applications; specifically how to do so without using the mouse. On my Linux boxes (one at home, one at work), I do most of my work from the keyboard, without resorting to the mouse, even in Gnome or KDE.
    In Tiger, I can select applications on the desktop, but haven't been able to figure out how to launch them without "clicking"... I've Googled and searched these forums, but no luck so far. Under Linux, it's the Enter key. I assume in Tiger it's some key combination...
    I know there's probably a simple answer, but I've not been able to happen upon the appropriate key combo it at random, so I thought I'd ask the experts.
    Be gentle, I've only had my PB a week!

    To help you in your quest to keep your hands on the keyboard you should check out apps like LaunchBar and Quick Silver. Your hands will never (well... rarely) leave the keyboard again.

  • Question about implementation of a webservice

    Hi
    I have successful implemented a webservice call in my webdnypro application. But I am not sure if I have done this the right way
    Scenario: I have a view which displays data from a business partner. These data can be accessed over a webservice. The webservice requires a parameter with the id of the bussiness partner.
    My solution: I have implemented a method in the component controller (*comp.java).
    public void getBusinessPartnerInfo( java.lang.String businessPartnerCode )  {
        //@@begin getBusinessPartnerInfo()
           service = new BPService();
           Request_GetBPInfo request = new Request_GetBPInfo(service);
           GetBPInfo getBPInfo = new GetBPInfo(service);
           getBPInfo.setCardCode(businessPartnerCode);
           request.setGetBPInfo(getBPInfo);
           try {
                request.execute();
           } catch(WDWSModelExecuteException ex) {
           wdContext.nodeRequest_GetBPInfo().bind(request);
        //@@end
    and I invoke this method from the wdInit method of the same controller.
    public void wdDoInit()
        //@@begin wdDoInit()
           this.getBusinessPartnerInfo("c1000");
        //@@end
    Therefor the data is available when the view is loaded. But I am asking myself if this is the right way to do that? Wouldn't it be better to call this webservice invocation from the init method of the view?
    Additionally I do not know at the moment how to access the environment of the portal for information. E.g. the business partner code c1000 is hard coded at the moment. I would like to read this code from the environment, e.g. the portal. Over which API can I access data from the portal or better say from the ume (where i can map a field to the business partner code)?
    Thanks for your answers,
    Thierry

    Hi,
    As far as your first question is concerned you can access the controller method from the view linked with the controller as follows:
    wdThis.wdGet<Contoller Name>Controller().yourMethod();
    I have no idea that you can store generic information such as BP code specific to a user in EP. Lets see.
    thanks & regards,
    Manoj

  • Noob question about trying to duplicate rows in a table

    Simplification of problem is I've got a table with user_id, name, year where user_id is pk. I would like to take all the rows that match year=2008 and insert them into the same table, but start the user_id at a certain number and set year=2009.
    I know this doesn't work, but it's what I want to do in noob-code:
    INSERT into TABLE (
    user_id, name, year
    ) VALUES (
    SELECT user_id_seq.nextval after starting at 3500, name, 2009 from same table doing insert to where year = 2008
    I've contemplated using a temporary table, I've also seen mention of cursors, but don't quite understand what they are. I'm really, really new to Oracle and SQL in general, but am familiar with programming and shell scripts. I know more in depth searching might land me what I want, but I think my search syntax would be just as weak as my knowledge of the material. I'm just thinking this is something so basic and easy that my searches aren't using the right terms to catch a hit.

    Hi,
    Welcome to the forum!
    You can INSERT all the results of a query by substituting the query where you otherwise would have "VALUES (list)".
    For example:
    INSERT into TABLE_X
           (user_id,              name,  year)
    SELECT  user_id_seq.NEXTVAL,  name,  2009
    FROM    table_x
    WHERE   year = 2008;This assumes that the sequence user_id_seq exists and is ready to issue the correct value. (It's unclear if that's part of the problem.)
    Temporary tables and cursors (which are a way of getting query results in PL/SQL) are only useful for inserting in rare situations, where you have to do very odd, convoluted things. Think (at least) twice about how to do what you need to in SQL, and if you can't think of a way, then ask.
    Yes, basic things often are hard to search for, especially if you don't know the right terms.
    There are several good teach-yourself SQL books that explain this kind of thing. Getting one would be a good investment.
    [All the Oracle manuals|http://www.oracle.com/pls/db111/portal.all_books] are on line. There's an example of this in the SQL Reference manual, under THE INSERT command.
    Edited by: Frank Kulash on Nov 26, 2008 12:59 PM
    Clarified usefulness of cursors. They have a lot of good, common functions, but helping with INSERTs is not one of them.

  • Again a noob question about parameterizing

    Im setting up an insert() for a binary tree. when i try to actually preform the setLeft or setRight command i get an error. My code is posted below.
    my node class
    public class BTreeNode<T extends Comparable<T>> implements Position<T> {
         public BTreeNode<T> _left;
         public BTreeNode<T> _right;
         public BTreeNode<T> _parent;
         public T            _data;
         public T element() {
              return _data;
         public BTreeNode(T c) {
              _data = c;
              _parent = null;
              _left = _right = null;
         public void setLeft(BTreeNode<T> n) {
              _left = n;
              if (n!=null) n.setParent(this);
         public void setRight(BTreeNode<T> n) {
              _right = n;
              if (n!=null) n.setParent(this);
         }my binary tree class
    public class BasicBTree<T extends Comparable<T>> implements BinaryTree<T> {
         public void insert(T obj) {
         if (_root != null) {
              BTreeNode<T> runner;
              runner = _root;          
             if
                      (obj.compareTo (runner.element()) == 0){
                         System.out.println ("Object was found in tree and will not be inserted");
              else if     
                 ( obj.compareTo(runner.element()) < 0 ) {
                            if (runner.hasLeft() == true){
                                 runner = runner._left;
                                 return;}
                            else {
                                 runner.setLeft(obj); // ERROR IS HERE
              else if
                   ( obj.compareTo(runner.element()) > 0 )
                             if (runner.hasRight() == true){                   
                                      runner._right = runner;
                                      return;}
                            else {
                                 runner.setRight(obj); // ERROR IS HERE
         else{
              _root = new BTreeNode<T>(obj);
         return;}   
         the error i am getting says that
    "The method setRight(BTreeNode<T>) in the type BTreeNode<T> is not applicable for the
    arguments (T)"
    or "The method setLeft(BTreeNode<T>) in the type BTreeNode<T> is not applicable for the
    arguments (T)"
    I had a similar question before and someone showed me where i had forgotten to parameterize my runner variable. I am thinking that this will be along the same lines although i cant imagine what it could be. The runner is already said to be part of BTreeNode<T> and setLeft and setRight are defined in the BTreeNode class so i wouldnt think that would be the problem. Anyway thanks for the time hopefully someone can help me with this.
    -peter

    Im setting up an insert() for a binary tree. Ceci already posted a solution to your problem, but may I suggest a different approach to your insert method? Trees are made for recursion!
    public class BasicBTree< T extends Comparable <T> > implements BinaryTree<T> {
        private BTreeNode<T> root;
        public BasicBTree() {
            this.root = null;
        public void insert(T item) {
            BTreeNode<T> newNode = new BTreeNode<T>(item);
            if(root == null) {
                root = newNode;
            else {
                insert(root, item);
        // private "helper" method
        private void insert(BTreeNode<T> currentNode, T item) {
            int difference = currentNode._data.compareTo(item);
            if(difference < 0) {
                // IF 'currentNode' has a left node
                //    Recursively call this method using the
                //    left node of 'currentNode' and 'item'
                //    as parameters.
                // ELSE
                //    Set the left node of 'currentNode' here.
            else if(difference > 0) {
            else {
                System.out.println ("Object was found in tree and will not be inserted");
    }

  • Noob question about Airport

    I have one of the early G5 PowerMacs (single 1.6 gHz). It currently doesn't have an Airport card, but I'd like to install one or an equivalent. Here's my two questions:
    1.) Are all G5s compatible with Airport Extreme cards?
    2.) Are there good third party alternatives out there?
    I wish Apple would be clearer about what systems are "Airport Extreme Ready".
    Thanks in advance!

    The Airport "Extreme" card for your G5 is here
    http://store.apple.com/1-800-MY-APPLE/WebObjects/AppleStore.woa/wo/1.RSLID?mco=3 93BD37&nplm=M8881LL%2FA
    An alternative here but no cheaper
    http://www.macwireless.com/html/products/11g11bcards/11gPCI.php

  • Noob question about HDR images

    hi everybody! i am reading this book about photoshop hoping to understand a lot more than i already know about pixels and colors and image dinamics and such..i got to the chapter about HDR images and here's what i dont get. as i understand, given a HDR image it has 32 bit depth meaning its file contains much more information about contrast and brightness than any existing monitor can output, so when u open it in photoshop u will never see its true quality. my question is( and i admit it may seem pointless to some, but i am committed to understand the cause and purpose), when converting it to 8 or 16 bit depth this window pops up asking me to tweak gamma, exposure, shadows and highlights, etc., but why is this linked to the conversion process? why not simply convert it, maintain the same appearance as before and then if needed manually adjust using all the image controls from the photoshop menus? i have CS6, if that matters.

    I don't know if this will help, but I've heard about HDR monitors (still very expensive), which supposedly very accurately display the HDR values. If you hang one on the wall in your house, people might think it's a window, since it is literally a source of light, in the same way a window to the outside world is.
    Possibly the most surprising use of HDR imagery is in 3D apps where global illumination models are used. HDR imagery literally is the only source of light for these images. There are no lights in the scene, only HDR imagery. This is because of the great dynamic range of HDR.
    A more practical (to me) use of HDR is when resurrecting antique images. If you scan multiple exposures from old prints, then create HDR, sculpting values in 16-bit becomes a very powerful tool, only due to the HDR value range.
    Photoshop, although it can edit very well in 16-bit, can only show 8-bit representations of HDR imagery, since almost all monitors are 8-bits per channel. Because of the monitors, we can only see a small part of what is actually present in the HDR file.
    I've never done it, but I imagine that if we all had HDR monitors, we'd need to wear protective glasses (like you wear driving in your car when the sun is out) most of the time to do our work.  :+)

  • A noob question about precedence...

    Ok, here's the question.
    let's say:
    int a=0;
    a=a++;
    when a is evaluated, 0 is returned.
    isn's that expression like this?
    a=a=0;
    a=a+1;
    apparently I'm wrong.
    so if i forced a parentheses on it
    a=(a++);
    but again, a is evaluated as 0,
    I know how ++a would work, but i'm really curious about the suffix one.
    can any one explain to me?

    i mean how no matter what u do to
    a=a++
    i know in this case that a is evaluated first b4 it is added to 1,
    but it's gona add that 1 eventually right? so the evaluation of
    a in the en should be 1.
    Ah, I'm so confused, help

  • Noob question about DIV tags

    Learning DW and CSS so patience is in order .
    I've being reading numerous posts here and on the web about avoiding tables for laying out web pages. I can see the advantages in terms of cleaner codes and easiness of updating and changing sites at a later time. So I started learning about DIV tags (although tables is very easy for me) and have practice a few times with fairly good results, love the absolute positioning with it. Having said that, for the love of me, can't find a way of centering horizontally a page designed with DIV tags (due to ignorance), for example, 1 column/three rows page, after defining styles, size and colors I enclosed everything in another DIV tag, wrapper I think is called, but have not found a way of centering it on the page, text-aligment on the DIV tag only centers the text not the DIV itself, how to go about this? Help is appreciated.

    love the absolute positioning with it.
    Get over it.  It's a trojan horse.  Absolute positioning is not a general layout method.
    To center ANY block (non-absolutely positioned) element, use CSS to give it a width and left/right margins of 'auto'.  For example -
    <div id="foo">...</div>
    That div will be centered with this CSS -
    #foo { width:300px; margin:0 auto; }
    I think you are on the wrong path already, though.  Stick with tables (which you say are very easy for you) UNTIL you a) understand CSS well enough to understand what absolute positioning is and why I say it's bad, and b) understand how to use float, margin, and padding to place things on the page.  Then you are ready to move away from tables.

  • [SOLVED Noob question about web server permissions

    Hi I have setup up succesfully my web server. Now I am having some permission's questions/problems.
    First of all, I want the /home/httpd/home folder not to be show to the other machine users and only to root.
    I have created a user www-data and I have conf the apache file.
    This is my settings:
    My server directory is: /home/httpd and the permissions I have set:
    home dir:
    ~edited because solved~
    I have set .htaccess to some folders. I don't know If the permissions are safe or not. Can you help me?
    I think that I have different permissions to files and different to the folders...
    Thank you!
    Edited:
    And an example of my permission (phpMyAdmin):
    ~edited because solved~
    Last edited by k3rn31 (2008-02-28 22:26:09)

    This is more of a chat item for me, if you feel like it you can find me most of the time here at http://zaxter.org/xmpp.html if you have flash you can join via a simple click on connect.
    Sorry I've not been of much help to you.

  • Question about implementing a Flex app in Wlp 1.3.2

    Does anyone have an example of implementing a flex application in weblogic portal? I'm trying to figure out how one flex portlet (java 286) can trigger an event and have another java 286 portlet catch the event.
    thanks

    Yes, you have the snmpEngineTime / .1.3.6.1.6.3.10.2.1.3 option on IOS 12.0(3)T or later, as explained in this post:
    https://supportforums.cisco.com/message/573246#573246

  • Ultra-noob question about creating clips

    Sorry if this is answered elsewhere - I don't even know where to look.
    I'm working on a simple editing project. I've sucked in (I forget the proper term) an entire DV tape of material into one big file. Now I'm trying to pick out the good shots and save them as separate clips - about 50 of them. These clips will then be converted to a different format and reassembled using some special software outside of FCE to create an interactive web video.
    There seem to be about a gajillion ways of doing this. Master clips, independent clips, sub-clips. Right now I'm having a problem with clip names because of the master/associate business. I want to organize individual clips into folders (Folder A -> Clips A1, A2, A3, etc). But when I try to name a clip, ALL the names change. And no amount of setting the clip as Independent seems to affect it. Not only that, but I'm so green I still can't figure out what to highlight - the clip in the timeline or the clip in the folder or both.
    Can someone point me in the right direction? I don't even know what to ask.

    G'Day ap0110,
    Welcome aboard the FCE forum.
    Here is another method:
    Double click the long clip in the Browser and it opens in the Viewer.
    Mark an In and Out point in the Viewer. You will have two black triangles facing one-another in the Viewer scrubber bar when completed. Notice the bit in between the triangles is lighter in color than the rest. This bit can be made into a re-namable Sub-Clip.
    Go to Modify> Make Subclip. Command-U (keyboard shortcut).
    The modified clip now appears in the Browser ready to be re-named. Enter new name.
    Do this as many times as required.
    Right click in the Browser and a pop up appears with an option to create a _New Bin_.
    Drag the newly named Sub Clips into a Bin of your choice.
    Al

  • Question about implementing a clock using a Timer object

    Hello all, I'm not sure if this is the correct forum to post this question but I think so, as it regards a Swing component. I want to add a timer (a clock that starts at 0:00 and keeps track of how long the app is running) to a frame. I am just curious if using a Timer is the proper way to keep track of time, and just repaint() the clock object every second? (or more frequently if desired)... or is there a better way to do this? Thanks in advance for any comments/feedback/help!
    Brian

    Hello,
    Timer is not accurate. You can use Timer to display your component repeteadly, and System.currentTimeMillis() at each call to deduce the elapsed time.

  • Noob question about the docking adapter

    Sorry guys, a real stoopid question... (but i would like a sensible answer)
    How on earth do i use the little plastic docking adapter that comes with the classic iPod? I guess the power cord goes through the bottom of it but is that it? I dont understand the point of it...
    Surely its just as quick to plug the power lead into the bottom of the ipod

    The little plastic "tray" you get with ipods are only for use with docking stations like Apple's or an iPod compatible radio with a dock/cradle that the iPod sits in. It just helps the iPod sit better in a the dock.
    For normal use with just the sync cable, you don't use the plastic adapter.
    Patrick

Maybe you are looking for