How to make objects appear in an applet

I have to do a program for school wich shows a switch,
it can have 2 possible positions and a light burning green/yellow for on/off...
I tried this and didnt get any messages/warnings:
package wissel;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class wissel extends Applet {
Button knop1, knop2;
public void init()
{ setLayout(null);
knop1 = new Button( "Rechtdoor" );
knop2 = new Button( "Afbuigend" );
knop1.setBounds(150,450,100,25);
knop2.setBounds(250,450,100,25);
add( knop1 );
add( knop2 );
public void paint( Graphics g )
g.setColor( Color.black );
g.fillOval( 350, 40, 150, 150 );
g.fillRect( 412, 180, 25, 250 );
g.fillArc(100, 380, 188, 100, 0, 180);
public boolean action( Event e, Object o, Graphics g )
if( e.target == knop1 )
g.setColor( Color.green );
g.fillOval( 375, 65, 100, 100 );
g.setColor( Color.black );
g.fillRect( 100, 200, 50, 180 );
return true;
if( e.target == knop2 )
g.setColor( Color.yellow );
g.fillOval( 375, 65, 100, 100 );
g.setColor( Color.black );
g.fillRect( 150, 380, 100, 200 );
return true;
return false;
But this doesn't show anything when I click on button 1 or 2 the screen stays like it is...
Could someone help me with solving/identifying the problem???????
Thanks a lot,
Menno.

package wissel;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class wissel extends Applet {
Button knop1, knop2;
private boolean rechtdoor, afbuigend;
     public void init()
     {   setLayout(null);
rechtdoor=true;
afbuigend=false;
     knop1 = new Button( "Rechtdoor" );
     knop2 = new Button( "Afbuigend" );
     knop1.setBounds(150,450,100,25);
knop2.setBounds(250,450,100,25);
          add( knop1 );
          add( knop2 );
public void paint( Graphics g )
g.setColor( Color.black );
g.fillOval( 350, 40, 150, 150 );
g.fillRect( 412, 180, 25, 250 );
g.fillArc(100, 380, 188, 100, 0, 180);
public void paint( Event e, Graphics g )
{ if( e.target == knop1 )
          {       rechtdoor=true;
afbuigend=false;
g.setColor( Color.green );
g.fillOval( 375, 65, 100, 100 );
g.setColor( Color.black );
     g.fillRect( 100, 200, 50, 180 );
repaint();
          if( e.target == knop2 )
          {       afbuigend=true;
rechtdoor=false;
g.setColor( Color.yellow );
g.fillOval( 375, 65, 100, 100 );
g.setColor( Color.black );
g.fillRect( 150, 380, 100, 200 );
repaint();
class wisselstaf {
     public void teken( Graphics g ) {
     g.setColor( Color.green );
g.fillOval( 375, 65, 100, 100 );
g.setColor( Color.black );
     g.fillRect( 100, 200, 50, 180 );
Please!
HELP ME!!!
This is killing me for days now!!!

Similar Messages

  • How to make object appear in all slides?

    I'd like to place a logo in the top right of a slide and have it appear in all slides.  If I adjust the logo in one slide, it will adjust the same in all slides.
    Any ideas how to accomplish that?

    Place the logo on the master slide being used in the presentation:   View > Show Masters Sides

  • Under bookmarks the Organize bookmark option does not appear, new computer Firefox 4.0, and Windows 7, how to make it appear, thanks

    Under bookmarks the Organize bookmark option does not appear, new computer Firefox 4.0, and Windows 7, how to make it appear, thanks

    "Organize Bookmarks" has been renamed to "Show All Bookmarks" in the bookmarks menu.

  • How to make arrows appear???

    Hey, I was wondering how to make arrows appear so I can point out what people did wrong in their softball swing and arm. Can you help me? Thanks.
    -Channing

    Hi Channing,
    searching the "usual suspects" I found:
    Stupendous - has some "highlighten" effects...
    and
    Geethreeoffers some "painting" (e.g. arrows) onto the video...
    I'm sure, searching at www.virtix.com and www.imovieplugins.com, you'll find more.....
    I don't profit from any recommendation or link, I'm a user, not a salesman.

  • How to make the oracle forms 10g applet or runtime the size of 1024x768?

    Hi,
    Can anyone tell me
    How to make the oracle forms 10g applet or runtime the size of 1024x768?
    Thanks in advans..

    Please post your question in Forms Topic
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com
    [Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

  • Unable to see Inspection lot stock tab in UD??? how to make it appear?

    Hello Friends
    Some how i am getting three unexpected observation
    1. Inspection lot stock tab in UD is not there.....how to make it appear so that i can do the quantity posting can be done.
    For your information this is against good receipt & QA32 quantity to be posted is showing the qty correctly.....which means stk is in quality
    2. In MMBE transaction i am not able to view batch & qty posting
    3  In MB51 i can see the document details but qty is showing in unrestricted....which means stk in unrestricted which contractdory to my first statement.
    Kindly let me know
    1. How to make Inspection lot stock table available in UD
    2 Any clue for 2 & 3 point if possible.
    Thanks & Regards
    Swanand

    Thanks for reply
    But the problem is not of stock going to quality or not.....anyway i checked it and it's correct.
    Problem is i am not getting Inspection lot stock tab in UD.......here this inspection lot is created due to good receipt (inspeciton type 01)
    My query is not yet answered
    Thanks & Regards
    Swanand

  • I cant find sharing folder under Internet & Wireless,How to make it appear(?)

    I cant find sharing folder under Internet & Wireless,How to make it appear(?)

    Does it still exist here?
    /System/Library/PreferencePanes/SharingPref.prefPane
    You can copy & paste this in Finder > Go > Go To Folder... (Command+Shift+G)

  • Hi! Since I installed Mavericks, all the messages in mail I receive are marked as read, when they're not! Can anyone explain to me how to make them appear as not read, so I notice them? Thank's

    Hi! Since I installed Mavericks, all the messages in mail I receive are marked as read, when they're not! Can anyone explain to me how to make them appear as not read, so I notice them? Thank's

    I don't know if it will work, but try rebuilding the mailbox. This can take awhile if you have a lot of mail.
    Rebuild mailbox

  • How to Make Hair Appear in Front of and Behind an MC Object?

    Hello again,
      I am making a character with lots of hair. I would like to know how to make the hair appear both in front of and behind the Movie Clip object.
      I'll explain further. I have the "frontHair" connected to the "head" MC. When I pivot the head, a bare spot shows in an outlined shape of the arms/legs/torso. I thought I'd remedy this by making "hairBack" and then layer it behind the object. This opens up a can of troubles.
      I can't seem to get the "hairBack" to appear behind the torso and arms. Also, the "frontHair" is now blocking me from grabbing onto the arms and legs.
      It's crucial that this character has all of the hair, but I can't seem to figure out how to make it happen.
      Please, help!
    Thank you,
       Mike
    p.s. While returning from a beer run, I thought about masking. I'm still trying to work out the logic on this one.

    Thank you for replying. II didn't know which specific layers and objects you were referring to, but I figured out the problem I was having.
      I used only one newly created "hair" object and set it to "Guide" to get it out of the way (in a sense). I then selected all the body parts (movie clips) that I could and selected "Move to Front" for each one. I used the Selection Tool to move the head (with connected hair) out of the way. After doing this I was able to select the "torso"; which was previously hidden behind the Armature Layer. I then put the head back in place and I was set to roll.
      Ah, but then I encountered another error. My animations are set to 24fps, but they are moving at least 10 times slower. This happens within Flash and in the exported swf files.
    The topic deals with "text field variable names" errors and compiler errors dealing with "Symbol 'fps' ".
    This is the address to that topic. http://forums.adobe.com/thread/1009225
    Thank you (again),
      Mike

  • How to make object dissapear and reappear?

    I was watching a video on YouTube on how to make an explosion. However, the video is not very helpful as the guy doesn't explain anything. I am not a complete newbie, but I still need some help on simple stuf sometimes. The part I am stuck on is when he makes a "patch" of the texture in the driveway, and then he covers up his explosive box. After that, he copies the box and is able to make appear and dissapear.
    The part of the video I don't understand is at 1 minute, 22 seconds.
    Here is the video link: http://www.youtube.com/watch?v=qL1KkAfwflk

    @Netcommercial, Sorry about the double post, nobody was replying so I thought maybe it wasn't specific enough. Anyway, changing the color of a box does not make it disappear. The guy in the video was able to make the box completely disappear (not by changing the color), and he was able to make it reappear too. That is what I need.
    @Rick Gerard, I understand he is using multiple layers, but how does he make the box reappear? Basically, you are saying that if I took a layer with an object, duplicated it, then put the original layer underneath the layer that has the mask, I would make the object disappear?

  • How to  make a good voip server +applet ?

    Here is my applet wich I made http://84.244.8.225/test.html
    It works a bit
    Here the code:
    http://84.244.8.225/javamic4.txt
    Any ideas/suggestions to make it better...
    (for example how to make a good server (windows) ?)
    Thx!
    Edited by: FrederikPot on Sep 24, 2007 3:01 PM
    Edited by: FrederikPot on Sep 24, 2007 3:03 PM
    Edited by: FrederikPot on Sep 24, 2007 3:07 PM

    Hello Thanks for your replys and sorry for being so fussy about this.
    I have now seen that one of the options for exporting from Premiere 6.5 is Adobe MPEG encoder. So Do you guys think it would be a good idea to do it with that, Or Would it be better AVI or DV AVI compressor from Premiere before making the DVD?
    I have the Nero Vision 4.9.6.6  But I may be able to look for another one if you think it is better...
    Thanks a lot for your advises...

  • How to make tornado appear at a distance in a video.

    I made an energy torndo effect with CC particle world, its on a black solid with the blend mode on screen (two weeks in learning this stuff haha). How can I add it to the video and make it appear as if its right in front of me on the far distance?

    I might also consider using a different method to create the tornado.  If you're looking for realism I'm not sure CC Particle World will do it for you.  Personally I would create this effect practically by building a tornado box, like the ones kids make for elementary school science fares.  Then I would light your tornado in a black room, and film it.  Then take it into After Effects, mask it out, flip it vertically, set the blend mode to screen and composite it using the same suggestions Rick has offered.  There are plenty of links that will show you how to create a tornado box using dry ice.  Here's the first one I found:
    Also this is a very useful tutorial for doing horizon replacement using Mocha AE:

  • How to make drives appear on desktop on os lion

    How to make drives (and flash drives) appear on desktop on os lion?

    Finder > preferences > General
    select the items to show on the Desktop

  • How to make bookmarks appear in all user accounts w/out importing and exporting everytime.

    Hello, all. I'm imaging a couple of laptops to be sent out. I want the bookmarks on the admin user account to be applied to the network domain user accounts or roaming profile is you will. Is there a way to this without have to import/export?

    I am trying to do the same thing. I also cant get it to work. I am
    thinking it may have something to do with the concept of ScopedResponse, but
    I am not sure. There is very little documentation and more importantly
    examples of how to make sense of the getOuterResponse() method. Dev2Dev and
    Google are of no help.
    Anyone care to explain this to us?
    Michael.
    "Zhenhao Qi" <[email protected]> wrote in message
    news:3fd4f634$[email protected]..
    >
    Hi All,
    I have a jsp page to display a table. I want to add a "excel download"button
    in this page, once user click this button, it will invoke the microsoftexcel
    and all table content will appear in the excel spreadsheet.
    I tried to set the content: <%@ pagecontentType="application/vnd.ms-excel"%>
    the rest code as following. However, it won't work for me. Does anyone hasany
    experience in doing this?
    <%@ page contentType="application/vnd.ms-excel"%>
    <%@ taglib uri="netui-tags-databinding.tld" prefix="netui-data"%>
    <%@ taglib uri="netui-tags-html.tld" prefix="netui"%>
    <%@ taglib uri="netui-tags-template.tld" prefix="netui-template"%>
    <netui:html>
    <head>
    <title>
    Web Application Page
    </title>
    </head>
    <body>
    <table border="1">
    <tr style="background-color:#3366ff;font-family:arial;">
    <td>Structure</td>
    <td>Compound</td>
    <% // Get the Items from the request stream
    Vector mr_names = (Vector) request.getAttribute("method_result_names");
    for (int f=0;f<mr_names.size();f++) {
    out.println("<td>" + mr_names.get(f) + "</td> ");
    Vector mrs = (Vector)request.getAttribute("method_results");
    for (int g=0; g<mrs.size(); g++)
    out.println("</tr><tr>");
    Vector row1 = (Vector)mrs.get(g);
    for (int f=0;f<mr_names.size()+1;f++) {
    String s = (String)row1.get(f);
    if (f==0) {
    %>
    <td><embed src="structure.jsp?Sample_code=<%=s%>"width="120" height="100"></embed></td>
    >
    <%
    out.println("<td>" + s + "</td> ");
    out.println("</tr>");
    %>
    </table>
    </body>
    </netui:html>
    Thanks!
    Zhenhao

  • Urgent please. How to make objects to vector? CS6

    Hi please urgent, the printing press for signboard is looking for an vector of my design there are waiting for me right now. I send them the .eps format. I use pen tool for making different curves and shapes. How can I make it to a vector?
    Here is the .eps file
    http://www.solidfiles.com/d/5164de41a2/

    It's not clear what kind of production workflow will happen.
    Exactly. (At last!)
    Hi please urgent...
    Given the "urgentcy" I'll first ask you to forgive my being a little rough. None of this is meant to offend. It's meant to teach with some appropriate pointedness, hopefully to the benefit of all who come here having got themselves into similar jams. So be a little thick-skinned in reading this, but take it seriously. It's sound advice. It's good advice. It's given freely and represents considerable time, and so I consider myself at liberty to phrase it the way I see fit.
    This is how you (and many others) get into trouble. Failure to read instructions. Failure to become familiarized with the basic principles and mechanics of a reproduction method before charging customers for designing for those methods. Then relying upon user forums for answers to get you out of a jam, when there is no guarantee that others on a user forum know any more than you do. Wrong or incomplete "answers" here are at least as common as correct answers.
    Your situation is no more "urgent" than most who come here with questions.
    I send them the .eps format.
    EPS is Encapsulated PostScript. EPS (like PostScript) can contain any combination of raster, vector, or text objects. Think of EPS as just a "container." Just because a file is EPS does not necessarily mean its content is entirely vector paths.
    I use pen tool for making different curves and shapes.
    You used the Pen tool for drawing a few simple closed paths. You combined some of those simple paths into compound paths. You converted some text to paths. Those objects are vector paths which can be translated to HPGL instructions which a typical vinyl cutter can use to direct its cutting blade.
    But then you filled some of those objects with graduated fills. Grad fills are common constructs and can be thought of as "vector in nature" (resolution independent) in that they are mathematically-described printing instructions. But that is not something that can be reproduced by cutting pieces our of solid-colored vinyl sheet material.
    Then you applied raster-based effects (the fuzzy drop-shadows) to some of those vector-based paths.
    Plus, the compound paths in the EPS file contain raster images used as transparency masks for the shading. Like grad fills, raster images cannot be rendered by cutting a shape out of solid-colored vinyl. And Draw X4 isn't going to know what to do with that construct.
    So you are not delivering just vector-based paths in this file, no matter what file format in which you save it.
    Whenever you deliver a file for sign cutting/printing:
    Know the limitations of the sign shop you are using and its kind of equipment. Some sign shops only cut solid-colored vinyl on an HPGL-driven cutter. Other sign shops have more expensive equipment which can print raster images or grad tones onto vinyl first, and then cut the printed vinyl to shape after. Some sign shops use separate equipment for those two operations. Just as in print, you can't know how to properly prepare something for a particular output workflow unless you have at least a basic understanding of the operations involved.
    Ask the sign shop what software and version it is using. Ask what formats and versions their software can open/import.
    Best practice: Have your own copy of the software the sign shop will be using. (CorelDraw can be had by any Illustrator user at a modest competitive side-grade price, and you receive alot of other useful stuff in the deal. Any designer frequently delivering files to sign shops should make this investment.) That way, you can see what they will actually be dealing with before you send it.
    Failing that, at the very least re-open the file that you export from Illustrator in Illustrator before sending it so you can see what kind of objects you are actually sending. If you Open your EPS in Illustrator and tear it apart, you'll see the objects that I described above.
    "Dumb down" your content to the "lowest common denominator" constructs. When it comes down to it, almost everything in graphics boils down to simple vector paths, compound vector paths, vector paths used as clipping paths, raster images, and text objects. Avoid proprietary software-specific constructs like meshes and effects. Figure out the most basic and fewest kinds of objects required to build the graphic.
    Make sure you do not use compression on the file that you export.
    How can I make it to a vector?
    First, do not say "a vector." A vector-based graphics file is not "a vector." "A vector" is a direction, usually associated with a force. A vector-based graphics file is a collection of vector-based paths. "Vector path" or "vector drawing" or "vector file" are shorthand terms using the word "vector" as an adjective (modifying the path, drawing, or file), not a noun. This is not just a pet peeve of mine. It's one of those dead giveaways of beginners who usually don't really understand what they're dealing with.
    I sent them the .pdf format...
    A PDF file is like an EPS file in that it is also a "container" which may contain any combination of any number of vector paths, raster images, or text objects (as well as many other constructs, such as data fields).
    ...but they are still asking for the .esp....he will do it using CorelDraw X4...
    Just as there are designers selling services they don't understand, there are sign shops using software they don't understand. Smart designers working with such shops learn to watch for the "tell tale" signs of amateurism in the output houses they use.
    CorelDraw X4 can indeed "open" (i.e.; translate into its native constructs) PDF, EPS, and AI, so long as:
    The files are not newer versions which the particular version of CorelDraw predates.
    The files do not include Illustrator-native constructs which CorelDraw does not understand.
    (This is not because Illustrator is in any way "superior"; the same general principles apply when exchanging files in the other direction. Each software has its own proprietary constructs for which the others don't have a directly corresponding native construct.)
    CorelDraw dominates in the sign business (and for good reason). But sign shops are notorious for not keeping their Corel software up-to-date. Current version of Draw is X6, and a new version is no doubt just around the corner. You are using Illustrator CS6. You just need to save your Illustrator files back to an earlier format and CorelDraw X4 can open them. In fact, I just:
    Opened your EPS file in Illustrator CS3.
    Saved as Illustrator 8.
    Saved as PDF 1.3 (Acrobat 4)
    Opened both the PDF and the AI file in CorelDraw X3, with nothing missing.
    Why did this work? Because in saving back to earlier versions, the content was automatically "dumbed down" (deconstructed) to the more basic building blocks of graphics: Separate vector paths and raster images.
    Understand, this is still not ideal, because leaving that deconstruction to automated routines still results in needlessly messy and fragmented content. For example, when opened in CorelDraw, the AI 8 file contains 36 vector paths and 53 individual raster images. (This is not Draw's fault. It's what was exported from AI to the legacy format.)
    ...after I send the vector .eps format he said "which you send eps it open but not it vector it has more part" What he mean by it has more part?
    He meant there are objects in the design which are missing in the file you sent him after opening in Draw. That's because you did not save back to an earlier format which would deconstruct the file to more basic elements.
    He said "I have to cut acrylic & then the sticker printing...
    I'm assuming that he means cutting from vinyl adhesive film (although it's quite possible he does indeed mean acrylic plastic sheeting for a fabricated sign.) This implies (although it's still not certain from the poor wording) that the sign shop is not limited to just cutting sign vinyl, but also has the ability to print onto sign vinyl (to accommodate the grads and raster-based shading). Based on those assumptions, you still have some qestions to answer. Think of the basic operations. Think like the device(s) that have to build the physical sign:
    The solid-filled vector paths can be cut from sheets of solid-filled colored vinyl. The cut vinyl can then be applied to the (assumed) white sign board. That part is simple.
    The grad filled objects can be printed on white vinyl and then cut to shape. But there are three problems:
    Registration of print to cut. What if the printing and cutting are done in separate operations? Just as in offset printing traps and/or bleeds are typically included to allow for slight mis-registration of abutting colors, a similar trap or bleed may be required to allow for slight mis-registration between the printed grad fills and the paths which will then cut around them.
    How do you intend the drop shadows to be handled? They are graduated, so they will have to be printed. But then what? How do you cut to shape a soft fuzzy edged image from a solid piece of material? Where will the cut be made? Obviously, it has to be cut beyond the edges of the fuzzy printed image. But where? Will the whole graphic that involves the graduated fills and transparency masks (the circles, three curves, and drop shadows) be simply printed onto a piece of white vinyl and then that white vinly be cut to a single circular or rectangular shape? Or will it be cut to an offset contour running parallel to the outer edges of the whole graphic? If so, can you live with the visibility of that cut edge which is not actually part of the design? What about when that cut edge becomes more visible (as it will in the real world, especially if deployed outdoors)? Either way, you have not provided a cut path for the drop shadow portion at all.
    Or do you want the entire design to be rendered on a single sheet of vinly so as to avoid that problem of a cut edge outside the bounds of the drop shadows? If so, you don't need any vector content at all. The whole thing could just be one big raster image.
    Crosscuts: Back to the assumption that you do intend for the smaller graphic to be cut out of individual shapes, you have two dark blue vector paths overlapping. If the cutter blade follows those two paths, then they will be cut up into five separate pieces. Those paths should have been unioned into one path. A similar overlap situation exists between two green paths. unnecessary crosscuts are a bad thing in sign vinyl. Climate changes can cause slivers or peeling to appear between the unecessary cuts.
    Overlaps: Overlapping vinyl pieces can also be problematic in built-up multi-layer vinyl signs. The vinyl is usually glossy and lighting can cause the bumps at overlaps to become distractingly visible. Where that is considered a possible issue, path operations should be used to "punch" different-colored paths from each other, and then appropriate offsets added to accommodate registration, much like building traps in offset printing.
    (The above considerations are among the reasons why proper logo designs are intentionally designed as line art to avoid dependency upon graduated effects. If essential to the design, graduated effects are not just problematic for signage, but also for low-res printing like flexography, engraving on plaques or writing pens, single-color printing, screen printing, and other common needs.)
    So to do this right, you have some decisions to make:
    If this design is to be rendered from individual cut vinyl pieces adhered to a white substrate, especially for outdoor use, I would:
    Convert to solid-colored line art. Ditch the drop shadows and grad fills altogether.
    Union the two overlapping dark blue paths.
    Union the two overlapping green paths.
    Punch the green and light blue paths from the dark blue paths.
    Create offset paths of the green and light blue paths. Intersect these with the dark blue paths. Union the intersections with the green and light blue paths.
    Assemble in this order: Light blue, green, dark blue. This would provide a slight "trap" of the two ligher colors underneath the dark blue where they "kiss."
    The above treatment would be the simplest and most outdoor-durable since no printing is involved.
    If this design is to be rendered from individual cut vinyl pieces adhered to a white substrate, but I insisted on the grad fills and drop shadows, I would:
    Provide one raster image consisting of the small graphic.
    Provide one vector cut path for that image.
    Povide solid-filled cut paths for everything else.
    JET

Maybe you are looking for

  • How do I align check boxes with text in the form?

    I'm most of the way there but I am stuck fixing the formatting misalignments. 1. What controls the little checkboxes? What's the best way to align them with the text? 2. Part of the form is controlled by some form-specific css and  part is getting in

  • Preview In Browser Suddenly Not Working

    I just encountered the problem of no longer being able to preview in brower. The browser (Firefox) opens, then I get a "Not Found" message. I have Firefox as my primary browser and I have "Preview uising temporary file" selected. I'm using CS3. I hav

  • Question on using dialog functions

    When I use some dialog function, such as two button dialog box, can I change some properties, such as the size of popup widow, font size and color? I just want to make some more friendly and professional interface of my application to users. Thanks. 

  • I only get sound on my "video" why is it only playing sound?

    I have Premier elements13 I follow all the instructions to the  point. when I Publish+share to computer it creates an MPEG file, it plays the sound but no picture/video? What am I missing?

  • ESS Links Description

    Hi all, how to change the description of the personal data link in Personal Information. "Enter,change or delete your data" this description i need to change . where do i need to change in R/3. Regards, rameshb