Applet Browser Display Problem

Hello, I'm a student learning java, I'm on my final assignment and came across a confusing problem, my applet won't display in my browser, although when I compile it, I get no errors.
Here's my code for anyone who can help.
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class surveyapplet extends Applet implements ActionListener {
     ageSurvey Panel1;
     Options Panel2;
          public void init() {
          setLayout(new GridLayout(10,20));
          Panel1 = new ageSurvey();
          Panel2 = new Options();
          add(Panel1);
          Panel1.inputage.addActionListener(this);
          Panel1.thebutton.addActionListener(this);
          Panel1.thebutton.addActionListener(this);
          add(Panel2);
     public void actionPerformed(ActionEvent event) {
          String text = Panel1.inputage.getText();
               if (event.getSource() == Panel1.thebutton) {
                    Panel2.outputage.setText(String.valueOf(text));
               if (Integer.parseInt(text) < 21) {
                    Panel2.Option1.setState(true);
                    Panel2.Option2.setState(true);
                    Panel2.Option3.setState(false);
                    Panel2.Option4.setState(false);
                    Panel2.Option5.setState(true);
                    Panel2.Option6.setState(false);
                    Panel2.outputage.setText("likes to run, likes toys and eats burgers.");
               if (Integer.parseInt(text) > 21 && Integer.parseInt(text) < 35) {
                    Panel2.Option1.setState(true);
                    Panel2.Option2.setState(true);
                    Panel2.Option3.setState(false);
                    Panel2.Option4.setState(false);
                    Panel2.Option5.setState(true);
                    Panel2.Option6.setState(false);
                    Panel2.outputage.setText("likes to run, eats burgers and likes toys.");
               if (Integer.parseInt(text) > 36 && Integer.parseInt(text) < 60) {
                    Panel2.Option1.setState(false);
                    Panel2.Option2.setState(true);
                    Panel2.Option3.setState(true);
                    Panel2.Option4.setState(true);
                    Panel2.Option5.setState(true);
                    Panel2.Option6.setState(false);
                    Panel2.outputage.setText("needs reading glasses, eats burgers likes to sit and likes toys.");
               if (Integer.parseInt(text) > 60) {
                    Panel2.Option1.setState(false);
                    Panel2.Option2.setState(false);
                    Panel2.Option3.setState(true);
                    Panel2.Option4.setState(true);
                    Panel2.Option5.setState(false);
                    Panel2.Option6.setState(true);
                    Panel2.outputage.setText("eats prunes, likes to sit and needs reading glasses.");
class ageSurvey extends Panel {
     Label age;
     TextField inputage;
     Button thebutton;
     ageSurvey() {
          age = new Label("please enter age");
          add(age);
          inputage = new TextField(20);
          add(inputage);
          thebutton = new Button("Click Here!");
          add(thebutton);
class Options extends Panel {
     Checkbox Option1, Option2, Option3, Option4, Option5, Option6;
     TextField outputage;
     Options() {
          add(Option1 = new Checkbox("likes to run"));
          add(Option2 = new Checkbox("eats burgers"));
          add(Option3 = new Checkbox("needs reading glasses"));
          add(Option4 = new Checkbox("likes to sit"));
          add(Option5 = new Checkbox("likes toys"));
          add(Option6 = new Checkbox("eats prunes"));
          outputage = new TextField(30);
          add(outputage);
Thanks in advance for anyone with a solution.

I've figured out the problem.
the lesson:
make sure you have all your class files in the same folder thatyour html file will be referencing.
in my situtation, when I compiled, it created three .class files, and I only had the main .class file in the folder my html file was referencing, not all three of them.

Similar Messages

  • Browser display problem in firefox

    After reinstall Vibe 3.3 to new server. Browser display problem in firefox. Last column only display half in the table. But IE is display fine. Any suggestion?

    Originally Posted by yuenc
    Sorry that, our company no planning on upgrade.
    And they said no problem before move to new server.
    Then you could try the workaround mentioned in comment 6: https://bugzilla.novell.com/show_bug.cgi?id=786587#c6
    According to the bug report it was found in 3.3, so either they had this problem before or they used an older version firefox than 16 prior to the server migration.
    Thomas

  • Browser display problem

    I am placing markers on a long piece of media. I am then dragging those markers to a new bin in the browser to make subclips. The problem I'm running into in the Browser is that the bins only display about 12 clips before they visually disappear they haven't gone anywhere because if I move some to another bin I can then see them. I apologise if this is a known bug. Is there a way to view unlimited items in a bin in the browser?
    FCP 6.0.6
    Thanks

    It's a bug. Try quitting the application and restarting. Sometimes this clear it.

  • Final cut express 2 browser display problems

    Have just acquired Final Cut Express 2, as I want to edit on an old G4, so I can use my old Apple Cinema display monitor.
    In the Browser window, all the text in the window is blurred, it just displays as black blocks, rather than letters. None of the text on any other window, or the text on the Browser tabs, is affected.  So I can't read the names of clips, or any of the effects.
    Using a Dual 867 Power PC G4, GeForce4 MX AGP graphics,  OSX 10.5
    Any suggestions appreciated!

    Thanks so much, that solved the problem! I would never have thought of looking under the system preferences menu, since it was only the Browser window which was affected. In OS 10.5,  you need to chose a minimum font size to deactivate smoothing for. I switched it off for all fonts of 12 or less, and text now displays properly in all windows.

  • Japanese text display problems in applet using plugin

    Hi,
    We've been beating our heads against the wall on this one for quite some time, so any help would be greatly appreciated.
    Our product uses a third party applet (Kavachart from Visual Engineering) to display graphical statistics from our database. We are currently localizing our product to support english and japanese. With Japanese enabled, all pages use euc-jp encoding. The problem we are running into is in the display of japanese text inside this applet in IE 5 and NS 4.7x when using the java plugin (1.3 or 1.4). If the default jre of the browsers are used, the text in the applet renders fine.
    On a suggestion from the supprot folks at Visual Engineering, I modified our code to set the defaultFont parameter on the applet to "serif, 14, 1". With this set, the text in the applet renders ok in IE, but NS on windows and unix is still broken. Given that we are doing all these tests on machines running a native japanese OS, it's not even clear to me why setting the defaultFont should even be required, but at this point, I'll take anything :-)
    Has anyone else run into this and either solved it or proven that a solution is not feasible? I'm at my wits end here....
    Thanks in advance,
    Mark Evangelisto
    Synchronicity Inc.

    If you are using different java plugin, you need to install the international version of the JRE; otherwise, some characters may not be able to display correctly since some of the properties files are missing.
    As for Visual Engineering's suggestion. I don't know why they tell you to set the default font on the applet because it may cause the browser to use the font specified. Your applet works on IE because it will try to use the best font to match the web page's content. For NS anything less then 6.0 (technology based on Mozilla), they never display web page correctly especially if you did what VE suggest.
    If you are running the applet on the native langauge OS with the international version of the JRE installed, the applet should display correctly without setting the default font. If it is not the native langauge OS, first you need to install the international version of the JRE and have the fonts that are able to display the language the applet use.

  • Problems with applet for displaying desktop app's output

    I inherited a desktop C++ (VC6) application that uses the user's web browser for output. When the system first wants to display output it writes a temporary html file, fires up the web browser with an html page with an applet that opens a socket that listens for messages on a particular port. The C++ app then sends the temp file name through the socket for the applet to display. When new output comes along the new file name gets sent through the socket and the applet updates the web page (so all of this work is just so that you don't get a new web page for each output). It uses a similar mechanism to display help (sending the relevant section number through the socket). The relevant Java looks something like this:
         m_serverSocket = new ServerSocket(m_theApp.m_port);
    and then later
         clientSocket = m_serverSocket.accept();
    Recently the Sun decided that connecting to localhost is a security risk (see http://sunsolve.sun.com/search/document.do?assetkey=1-66-246387-1), so that this accept() now throws a security exception. I'm trying to fix this but I'm not getting anywhere. Here are the things I've tried and decided doesn't work (feel free to point out mistakes or misunderstandings on my side, I'm a noob at java):
    1) I changed the C:\Program Files\Java\jre6\lib\security\java.policy file to add "accpet" for localhost:
              permission java.net.SocketPermission "localhost:1024-", "listen,accept";
    this works, but I can't use this because a) it isn't safe, b) we don't want users to have to change their java.policy files and obviously the installer can't do it
    for them.
    2) I don't want to sign the applet because this will be really confusing to users (why should they be asked to trust anything from a desktop app that doesn't even do
    anything over the net?)
    3) I've tried passing a command line parameter to the applet in order for it to use an "application" specific policy file, but it seems that an applet can't take
    the -Djava.security.policy command line parameter.
    4) I've read that unsigned applets can (only) open sockets back to the server from which it was loaded, but I'm not using a webserver so there is no server URL (and
    localhost doesn't work).
    I'm out of ideas but would love to hear some!
    Paul

    Pay $150 or so to get your certificate signed by one of the major Certification Authorities. Signing your Jar will then stop the user being asked if he trusts the signer.

  • Hello! The new version of Firefox I have a problem with opening the site VKontakte. The browser displays the following error: "Firefox has determined that the s

    Hello!
    The new version of Firefox I have a problem with opening the site VKontakte. The browser displays the following error: "Firefox has determined that the server redirects the request for this address in a way that it will never end." How to solve this problem? Please excuse me for my English.
    Sincerely, Vsevolod.

    You're welcome

  • Why is netflix having display problems on my macbook pro... HDCP compliance?

    Watching Netflix and all of a sudden it says "Display Problems"  Make sure your monitor is HDCP Compliant and is not setup for mirror airplay??

    The issue is from Safari defaulting to HTML5 vs using Silverlight like it did in Mavericks.
    So the options are, if you want to use Safari goto your Netflix account, playback preferences and turn off HTML5. This will revert to Silverlight and will AirPlay fine*in Safari.
    If you want to use HTML5, just leave the setting for HTML5 on in Netflix and use Chrome, Firefox, etc.
    You can't currently have both Safari and HTML5 Netflix when using AirPlay. You'd think Safari would be a little bit more powerful with Apples stances on browser extensions.

  • Multiple instances of the same applet loaded causes problem

    I have a java applet that has several classes in the project. The applet has a JTable a JButton and a JLabel control. The applet is displayed within an HTML page. The problem is that if a user opens the same html page more than once with the applet in it, only the last applet loaded receives the screen updates.
    For example in one senario. I have an error message that displays in the Label control once they click on the button.
    The user opens the html page and the applet is loaded (window 1). The user then opens the same html page again (window 2) with window 1 still open. If the user clicks on the Button in window 1, the error message is displayed in the window 2 applet.
    Originally I had some static variables. Thinking it was being used globally by the JVM so I removed all of them and it still happens. I have tried using both the Applet and Object tag. But it still happens.
    Has anyone experienced this before? Any suggestions on how to make the applet update the instance that recieved the events and not just the last one that was loaded?

    You need to look at applet classloader issues. If applets have the same archive list and come from the same codebase, they have the same classloader. A class is namespaced by it's class + classloader. Any statics in a class with a classloader will be shared. If you instead make it such that your applets have unique classloaders (which you can't change for unsigned applets by yourself) by changing the codebase, that would be one solution.
    For other solutions, I recommend searching the forum. This issue comes up a lot.

  • Windows 7 64 bit on iMac display problems and instability

    I received my iMac 27" quad core with 8 gig ram & 2 x 1 TB hard drives last Friday. I'm using Boot Camp to run windows 7 64 bit on maximum 2560 x 1440 screen resolution.
    I get intermittent but often display problems in windows 7. I get areas of the screen covered in little yellow dots or blue squares (never red artefacts.) This will happen at random areas of the screen, inside an open window, around borders of windows and so on. Most often the screen will go black and come back with a message in the bottom right corner of the screen saying 'Display driver has stopped responding and has recovered' with the sub message saying 'display driver ATI radeon family stopped....etc'. Sometimes I lose the screen wallpaper. Once I've had the system just shut down, once I've had Photoshop seize up and I had to do a cold reboot. Could this be an overheating problem or resolution too high problem or driver problem? Windows 7 tells me my drivers are up to date. I tried installing the drivers for the card from ATI's website which made no difference
    The reason I bought a Mac is because it's the only effective way to code for the Mac family of OS's in XCode. The reason I didn't just attach a miniMac to my PC monitor was because there's rather a lot of advertising by Apple about the fact that you can use a Mac with a PC OS via Apple's own Boot Camp. Now I have a lot of Windows software (some of which is not available for the Mac or requires buying again) sitting on an unstable system. Any ideas would be much appreciated...

    Sorry, that thread got moved for edit and as a user tip... which I didn't want and won't be doing....
    Here is the post:
    A tip and workaround for how to get ATI mobility/laptop drivers so that Windows no longer thinks the ATI is a desktop card:
    http://discussions.apple.com/thread.jspa?messageID=11286987
    Summary (my own edit steps):
    1. Install Boot Camp 3.0 and upgrade to 3.1
    2. Uninstall graphic drivers and run Driver Sweeper
    http://www.guru3d.com/category/driversweeper/
    instead of:
    removing the crashing driver by going into windows 7 setup via its install cd and deleting the ati driver manaully
    3. Install ATI Mobility (link)
    4. Uninstall ATI (Programs control panel?) Device Manager (rollback; uninstall?)
    5. Device Nanager: update driver and BROWSE BACK to 8.681 (the original apple driver that was causing freezes and purple artifacts) - navigate to /Apple/Drivers/ATI
    (Apple uses) a 4850 card in the iMac, its modified a bit for apple. Enough that desktop drivers don't work, and modded-for-laptop desktop drivers don't work either.
    Now the upshot of using modified drivers is that it FORCES the catalyst control panel to be installed, meaning you get a few more options to mess around with the card.
    I couldn't use the original apple drive, it locks up, the newer one had banding, the newer radeon drivers direct form ATI wouldn't work until they were modded and then they cause black screens.
    SO the solution, as obscure as it was, was to download ACTUAL mobility Radeon drivers - version 10.3 still, but made for laptops.
    http://support.amd.com/us/gpudownload/Pages/index.aspx
    THESE drivers I was able to install - and here is where things changed.
    THIS driver changed they way windows saw the video card in device manager.
    As I mentioned before, its NOT a desktop card, its a modified laptop card, but installing mac drivers makes windows THINK its a full desktop card, and running the original 8.681 driver crashed it.
    Once installed 10.3 LAPTOP driver it now appeared in device manager as a MOBILITY card.
    +These Steps "should" work:+
    delete ATI driver manually
    reinstall apple driver after that and see if that works,
    otherwise try the steps above
    (mod drivers, remove via windows recovery off setup disk, install laptop drivers, reinstall apple driver over it)

  • ITunes 7.0.1.8 Freezes Windows when Cover Browser display option selected.

    When I select the Cover Browser display option for Music Library the entire operating system freezes within 3 seconds after the button is selected. After rebooting and deleting all music and selecting the option the freeze did not occur. I reimported a CD and tried again and the freeze occured again. ITunes works fine otherwise.
    Compaq Presario 2100 Windows XP Pro
    Compaq Presario 2100 Windows XP Pro
    Compaq Presario 2100   Windows XP Pro  

    I setup a new user on the computer. The problem does not happen under new user.

  • Display problem after apple repair

    Hello everyone,
    Few weeks ago had this problem with vertical lines on my iMac display, which apple told me it was a display problem and they needed to changed it. So far so good... despite the 300pounds i had to pay for a new screen but anyway....... now look what happened...
    i was wondering if anyone has seen this problem before (i wish i could browse on internet about this problem, the thing is: with my screen like this i cant distinguish what is or isn't a good image when i watch videos/pic posted from other users regarding displays problems)... do you think is any graphic problem? or display again?
    i'm so upset
    Thanks

    Thanks for your reply.
    I've just done it and the screenshot looks fine on my iphone. So... LCD problem again...? great
    can you see any problem on this screenshot?
    Thank you for you help.

  • Display Problem - Light Coming From Top

    Hello,
    So I recently purchased a 27" iMac, and have noticed a display problem when viewing in full screen mode. Its only an issue if there is black along the top of the screen (such as the black bars when watching a movie or trailer). When there is black along the top, you can see some white light kind of bleeding in from the top edge - kind of all the way along (very narrow), but more pronounced at certain spots. I browsed the forums, but couldn't find anything that seemed real similar (though there are a number of reports of a yellow tinge on the bottom).
    I guess I"m just wondering if this is a common LED problem - or if my display may be defective, and I should take it back.
    Thanks in advance.

    Hi Pullo
    There has been a few reports, but nothing wide spread.
    http://discussions.apple.com/thread.jspa?messageID=3005885&#3005885
    http://discussions.apple.com/thread.jspa?messageID=7722386&#7722386
    If it's noticeable, then most definitely take it back.
    Dennis

  • Display problem- Missing letters

    Hello there,
    I had a display problem with my 15" mac book pro. Sometimes the words on the menu bar will have missing letters. For example, F le Ed t Vi w and etc. This does not only happen in the main interface, it also occurs when I'm browsing websites (the contents have missing letters too)or open other applications(iphoto, imovie) The problem is getting worse these days, I 'll have to restart my computer every single time when it happens.
    Does anyone have any solution to this technical issue?
    Thank you very much,
    Lilly

    I tried IVMichael's suggestion above and had no joy, but when i restarted i found a file called /Users/your_name/Library/Preferences/com.apple.LaunchServicesQuartantined
    after deleting that and restarting i seem to have solved the problem.
    Good luck

  • Display problem w/Mozilla

    Hello! I can't get Firefox (any versions including Nightly and Aurora) to display properly on my HP Omni220. It installs fine, but when I open the program there's a brownish veil over the start page or only half  of start page is displayed. Firefox worked fine until an update by Firefox last Sept then this problem. I couldn't get around it then but was able to install Nightly and it was operating just fine until last week. OS is Windows 7 64bit
    I'm hoping to find the solution to this problem here--I've tried just about everything on the internet uninstall and reinstall, I've gone through the trouble shoot process and still no solution.
    Can anyone out there help?
    Addendum plunking around in my acount data, I'm new to this, Mozilla 4 is listed as browser used? Now I am throughly mystified

    There are a number of validation errors (64) which could be a
    starting
    point:
    http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.taylortownsales.com%2F
    btw, bottom of home page "The Perfect Gift for any occassion"
    should be "The
    Perfect Gift for any occasion" <---
    Jo
    "rn2go" <[email protected]> wrote in message
    news:fadcab$402$[email protected]..
    >I finished the design of my new website and it looks ok
    in IE. When I
    >checked
    > Netscape and Firefox, they both placed a major part of
    the display on the
    > right
    > side of the <body> and outside the viewing area.
    Dreamweaver gives no
    > indication of a browser compatability problem. Can
    someone help?
    >
    > You can look at the site at
    >
    >
    http://www.taylortownsales.com
    >
    >
    >

Maybe you are looking for

  • How do i set up my airport extreme to access from my work windows based PC

    How do I set up my airport extreme to access from my work windows based pc?

  • Adobe Air package damaged -problem

    Hi! I packaged my Adobe Air HTML/JavaScript -application with Dreamweaver CS 5.5 AIr Extension. Packaging with homemade signature went without any problems, but installing the application doesn't work. I get the error #1000 during installation. I sus

  • ALV Grid sub total issue

    Hi SAP Experts, Currently I have ALV Grid table as below as example : FIELD1 FIELD2 Account Amount 1. Rev 1.Rev Acct1 100.00 1. Rev 1.Rev Acct2 50.00 Subtotal FIELD2 (1.Rev) 150.00 Subtotal FIELD1 (1.Rev) 150.00 2. Cost 2.1 Cost1 Acct3 100.00 2. Cost

  • Problem in loading

    Hi experts, Am loading data from Flat file to infocube... The data in datasource is same as flatfile but when transfered to cube, the key figures are doubled... let me know whats the problem...

  • Layering and locking a h.264 movie on top of a flash file

    Let me start by apologizing. My Flash skills far outdo my DreamWeaver abilities, so I'm pretty new at the program. I have run into a problem that has forced me back to DW and that is for the video quality I need, I have to use Apple's H.264 codec; ho