Am I doing something really stupid?

I can't understand why this won't compile, I must be doing something wrong, but I can't for the life of me figure out what:
import java.applet.Applet;
import java.awt.*;
public class myApplet extends Applet{
     Isosceles triangle=new Isosceles(2,2,5);
     int perim=triangle.getPerimeter();
     System.out.println(perim);
Errors:
myApplet.java:8: <identifier> expected
System.out.println(perim);
^
myApplet.java:8: cannot resolve symbol
symbol : class out
location: class java.lang.System
System.out.println(perim);
^
2 errors
Can anyone help?

You can't have code within a class body like that, a class body can only have declarations. You need to write a method (or constructor, or initializer block) where to put those lines.
Here's a popular way of doing it:
public class myApplet {
public static void main(String[] args) {
Isosceles triangle=new Isosceles(2,2,5);
int perim=triangle.getPerimeter();
System.out.println(perim);
(btw if you thought you are writing an applet where do you think the output from System.out.println will go?)

Similar Messages

  • I Did Something Really Stupid

    I need help. Desperately. I was trying to change my short name for my computer. Okay...stupid idea already, I know. So I changed the name of my home folder (from Betsy to Kate). So the only thing that happened was the name change. So then I change my mind and try to change it back to Betsy...then it says that the name Betsy is already used. I have no idea what that means. So I foolishly restart my computer and now everything is screwed up. I still have all of my old files under Machintosh HD > Users > Kate
    I'm freaking out right now, did I make a new user? How can I make everything the way it was? And just how badly did I screw up?
    Thank you for any help at all. I'm super scared that I'm going to lose everything!

    Henry G4 wrote:
    Restart, change the home folder back to Betsy, and restart again.
    ... and DON'T do that again...

  • I've done something really stupid.....

    .... I've put some files in to .dmg image and password protected the file..... now I've forgotten the password!! Is there any way to break into it, or do I have to do all the work again (sob sob)!
    Thanks,
    Andy

    If you unchecked the 'remember password in keychain' option when creating the dmg, than there is no other way to get the password back. If you have Time Machine, than the 'doing it again' process will be MUCH faster. Just restore the files back to when you didn't have them on a dmg.
    That is the problem with password protecting folders.
    ~Christoph

  • FXML Scene Is acting weird, Or im doing something very stupid

    Hi Guys.
    heres whats happening, i have a circle and a cubic curve.
    I want my Circle to do a pathTransition in that cubic curve. The problem is, It doesnt do it where i want to. It starts way out of the line, and i need to manually insert the circle where i want it to. But it always go out of the line, no matter what.
    I did a testLine to see waht was happening and i had to do this :
    c1.relocate(lineTest.getStartX() + 90,lineTest.getStartY() - 10);
    Anyway, what am i doing wrong ?
      @FXML
        private void moveToBottomSpot()
         Path onePath = new Path();
        c1.setVisible(true);
        //c1.relocate(lineTest.getStartX() + 90,lineTest.getStartY() - 10);
        c1.relocate(lineOfBottom.getStartX() - 10 ,lineOfBottom.getStartY() + 25);
        final PathTransition pathTransition = PathTransitionBuilder.create()
                .duration(Duration.millis(1500))
                .cycleCount(1)
                .node(c1)
                .path(lineOfBottom)
                .build();
           pathTransition.play(); 
        }

    Ok.
    I re-made the program without FXML and it works great. But, i have an issue.
    How i reverse the path that a node makes ?
    I think i need to use timeLine;
    Can anyone give me a hand ?
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package PilhaBola;
    import javafx.animation.PathTransition;
    import javafx.animation.PathTransitionBuilder;
    import javafx.animation.Timeline;
    import javafx.application.Application;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.scene.Group;
    import javafx.scene.Node;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.paint.Color;
    import javafx.scene.shape.Circle;
    import javafx.scene.shape.CubicCurve;
    import javafx.scene.shape.CubicCurveBuilder;
    import javafx.scene.shape.Rectangle;
    import javafx.scene.shape.RectangleBuilder;
    import javafx.scene.shape.Shape;
    import javafx.stage.Stage;
    import javafx.util.Duration;
    * @author André
    public class PilhaBola extends Application {
         * @param args the command line arguments
        public static void main(String[] args) {
            launch(args);
        @Override
        public void start(Stage primaryStage) {
         Group root = new Group();
          Rectangle r0 = RectangleBuilder.create()
                    .fill(Color.TRANSPARENT)
                    .y(380)
                    .x(260)
                    .width(140)
                    .height(80)
                    .build();
          Rectangle r1 = RectangleBuilder.create()
                    .fill(Color.TRANSPARENT)
                    .y(300)
                    .x(260)
                    .width(140)
                    .height(80)
                    .build();
          Rectangle r2 = RectangleBuilder.create()
                    .fill(Color.TRANSPARENT)
                    .y(220)
                    .x(260)
                    .width(140)
                    .height(80)
                    .build();
            r0.setStroke(Color.BLACK);
            r1.setStroke(Color.BLACK);
            r2.setStroke(Color.BLACK);
            Circle c0 = new Circle(550,20,20,Color.BLACK);
            Circle c1 = new Circle(550,70,20,Color.BLACK);      
            final Circle c2 = new Circle(550,130,20,Color.BLACK);  
            CubicCurve cc0 = CubicCurveBuilder.create()
                .startX(520)
                .startY(150)
                .endX(320)
                .endY(430)
                .controlX1(320)
                .controlX2(320)
                .controlY1(50)
                .controlY2(420)
                .stroke(Color.BLACK)
                .opacity(0) 
                .build();
            final CubicCurve cc1 = CubicCurveBuilder.create()
                .startX(520)
                .startY(150)
                .endX(320)
                .endY(350)
                .controlX1(320)
                .controlX2(320)
                .controlY1(50)
                .controlY2(420)
                .opacity(0) 
                .stroke(Color.DARKBLUE)
                .build();
             CubicCurve cc2 = CubicCurveBuilder.create()
                .startX(520)
                .startY(130)
                .endX(320)
                .endY(270)
                .controlX1(320)
                .controlX2(320)
                .controlY1(50)
                .controlY2(270)
                .stroke(Color.PINK)
                .opacity(0) 
                .build();
             Button push = new Button("Push");
             push.setOnAction(new EventHandler<ActionEvent>() {
              @Override
                public void handle(ActionEvent event) {
                    final PathTransition pathTransition = getPathBallToStack(c2,cc1);
                    pathTransition.play();
             Button pull = new Button("Pull");
             pull.setOnAction(new EventHandler<ActionEvent>() {
                @Override
                public void handle(ActionEvent event) {
                    final PathTransition pathTransition = getPathStackToBall(c2,cc1);
                    pathTransition.play();
            root.getChildren().add(push);
            root.getChildren().add(cc0);
            root.getChildren().add(cc1);
            root.getChildren().add(cc2);
            root.getChildren().add(c0);
            root.getChildren().add(c1);
            root.getChildren().add(c2);
            root.getChildren().add(r2);
            root.getChildren().add(r0);
            root.getChildren().add(r1);
            Scene scene = new Scene(root,600,600);
            primaryStage.setTitle("Hello World!");
            primaryStage.setScene(scene);
            primaryStage.show();
        public static PathTransition getPathBallToStack(Node n,CubicCurve p)
            final PathTransition pathTransition = PathTransitionBuilder.create()
                .duration(Duration.millis(1500))
                .cycleCount(1)
                .node(n)
                .path(p)
                .build();
            return pathTransition;
           private static PathTransition getPathStackToBall(Node n,CubicCurve p)
                final PathTransition pathTransition = PathTransitionBuilder.create()
                .duration(Duration.millis(1500))
                .cycleCount(1)
                .node(n)
                .path(p)
                .build();
            Shape path = pathTransition.getPath();
            Timeline timeline = new Timeline();
            return pathTransition;
    }

  • I Did something really stupid, I spilled syrup on my keyboard is there anyway I can clean it out ?

    My little brother was handing me a plate and i wasn't paying attention and some of the syrup got into the keys. I was able to get some out but you can tell where the syrup is stuck. I really need help getting it out !

    Disassembling the MacBook Pro to even get to the keyboard (pretty much the whole MacBook needs to be taken apart) to clean only that component is not an easy task...I know first hand because I've done it (I have many years of building & maintaining PCs beginning from the early 80's).
    About the best thing you can do is make a free Genius Bar reservation to get an idea of the repair cost. If you have no warranty left, be prepared for some serious sticker-shock...$300 - $500 I would assume. They will replace the entire top-case (CNC machined Aluminum top case & keyboard)...this is why the repair is so expensive. The keyboard is literally screwed to the aluminum top case using some where around 100 teeny-tiny screws. Be aware that other components of the MacBook may be damaged as well.
    https://www.apple.com/retail/geniusbar/
    You also have the option of finding a local non-Apple repair facility. A repair will likely be cheaper there but any warranty you have left will by voided by going this route.

  • I just did something really stupid.  How do you unintall something I just installed?

    I was surfing looking for certain images for my 11 year old's school project.  It went into a site that was very inopopreiate.  All the sudden, Mac protector came on and I installed it thinking this is the way to protect my computer and now the image is keep popping up and I cannot erase it.  I don't know how to install this.  Will someone help me?
    Totally lost mom,

    There are different variants of names for this malware but the steps of removal should be the same unless it has advanced.
    http://www.macoscompatible.com/news/story/how_to_remove_mac_defender_malware.htm l
    http://www.securemac.com/MAC-Defender-Rouge-Anti-Virus-Analysis-Removal.php
    https://discussions.apple.com/thread/3032201?start=0&tstart=0
    https://discussions.apple.com/thread/3042885?start=0&tstart=0
    http://www.reedcorner.net/news.php/news.php?s=macdefender

  • Use that little button to engage the tab list There is a tiny little button, you may have been ignoring. It does something wonderful. It looks like a really sm

    I am using Firefox Version 17. Previous versions had a triangle on the right end of the toolbar that would show a list of tabs open on the window. I no longer see it.
    It was described in the "Help" instructions as follows:
    There is a tiny little button, you may have been ignoring. It does something wonderful. It looks like a really small downward triangle. Use that little button to engage the tab list.

    See also:
    * Permanent List-all-tabs Button: https://addons.mozilla.org/firefox/addon/permanent-listalltabs/

  • Every time I try and create a new folder on my desktop, it is never empty, but contains all my existing files. Am I doing something stupid?

    Every time I try and create a new folder on my desktop, it is never empty, but contains all my existing files. Am I doing something stupid?

    Is this what it looks like when you open the new untitled folder:
    The left column always shows unless you choose 'hide sidebar' in the Finder View menu drop down options and, on mine,  it shows two items on my desktop - the new folder and a previously created folder.

  • I must be doing SOMETHING stupid!

    OK, so I'm the only person in San Francisco who does not have an iPod. But I would like to listen to some iPod broadcasts which are available from the iTunes store.
    I can get to the correct destination in the iTunes music store: Podcasts>PBS>Shields and Brooks|NewsHour with Jim Lehrer Podcast|PBS. Once there, it looks a lot like the setup when I purchase and download regular music from the store (which I do with no problems).
    The main difference is that there are various buttons which say "Subscribe" and "Get Episode", but when I push them nothing happens.
    If I select an episode and double-click on it, it appears in the player window, but cannot be played.
    Evidently there is more to this podcast stuff than I realize. Any help will be appreciated!
    Thanks
    OS10.4.9 / Dual 2ghz G5, 4.5g SDRAM / 1.5ghz G4, 2g SDRAM / SE30, 256k RAM   Mac OS X (10.4.9)  

    Hello Joseph... what an amaziang new world this is: a question from San Francisco, an answer from London!
    We were both right: Podcasts were disabled, and I WAS doing something stupid, as usual.
    Thanks
    Dan Banchero
    OS10.3.9 / Dual 2ghz G5, 4.5g SDRAM / 1.5ghz G4, 2g SDRAM / SE30, 256k RAM Mac OS X (10.3.9)

  • Creative Cloud - Does Adobe REALLY Care About Customers?

    I hope the staff at Adobe are reading these forum posts.
    First question: the following quote
    As far as the future of CS applications, in his Adobe MAX keynote, David Wadhwani said, 'We have no plans' to continue perpetual licenses. We are not ruling that out in the future.
    Just exactly what is meant by this statement? Is Adobe already looking for a back door if the Create Cloud doesn't pan out? I really would like to know what this means. It sounds ominous and dubious and it sends mixed messages.
    As far as the Creative Cloud model goes, is this really a benefit to your customers? I can see it might make Adobe a lot of money (if you don't lose a vast majority of your customer base) but how does it really benefit your customers? Your loyal customers? The customers that made you the rich company that you are today.
    Speaking for myself, I do not use all the programs that will be available in the cloud on a regular basis. During the summer when I don't have classes, I don't use some programs at all. But I have to keep paying whether I use them or not. If I stop paying, I will lose access to my software. How is that a good thing for me?  For the majority of your customers? You think because we pay a monthly fee that most people won't equate that we are having to fork over more than $300 a year? In some cases over $600 a year. And it never stops. How is that good for the majority of your customers?
    Do I really need to have the latest software constantly? No, I don't. But you are now forcing the issue whether I want it or not. Forcing your customer to do something does not seem like you really care about me.  About us.
    What about my students? We have hundreds of students that go through our Adobe software classes each semester. Every student told me they would not go with the Cloud, either because they don't have the money or they were going to protest Adobe's "money grabbing scheme" (one student's actual quote). The students sure don't think Adobe cares about them. If the students stop taking the classes because of the software access, then we start cutting sections. Does Adobe care about that? I'm sure no, but think about those hundreds of students each semester that will no longer be learning to use Adobe software.
    Adobe is putting a stranglehold on its customers and the customers are going to say  enough is enough.  Perhaps new software (open source?) will emerge to take the place of Adobe. Perhaps people using InDesign will go back to QuarkXPress. Perhaps enough of these former Adobe customers will force Adobe to check their hubris and greed at the door. But maybe not. The world will move on, one way or another.
    One thing I am supremely sure about is Adobe has got it really, really wrong on the Creative Cloud strategy.
    BTW, you might want to read the following link entitled Adobe Creative Cloud:  Lopsided Legal Agreement. It is not pretty:
    http://macperformanceguide.com/blog/2013/20130508_1a-Adobe-legal-agreement.html

    Nice sentiments, could not agree more.
    xIDx wrote:
    What about my students? We have hundreds of students that go through our Adobe software classes each semester. Every student told me they would not go with the Cloud, either because they don't have the money or they were going to protest Adobe's "money grabbing scheme" (one student's actual quote). The students sure don't think Adobe cares about them.
    I hope this occurs across the globe with students ("potential" future Adobe customers) whom may be hindered in their monetary abilities but not in seeing the truth towards what it being placed upon them by Adobe concerning the Cloud mirage. This is a great opportunity for educators to truly educate their students about Adobe.
    xIDx wrote:
    One thing I am supremely sure about is Adobe has got it really, really wrong on the Creative Cloud strategy.
    BTW, you might want to read the following link entitled Adobe Creative Cloud:  Lopsided Legal Agreement. It is not pretty:
    http://macperformanceguide.com/blog/2013/20130508_1a-Adobe-legal-agree ment.html
    Great link!

  • Is this a bug in ipod software or am i doing something wrong?

    I got my ipod video a few weeks ago and was excited to be able to carry all 7000+ songs around in one place.. but then i ran into this problem and i'm not sure if it's a bug or if i'm doing something wrong.
    let's say i have exactly one album by an artist.. and i also happen to have some singles from the artist, with no album set... (i prefer not to have albums set for songs i don't have the entire album for, to keep from having to sort through a truckload of albums i don't completely have).
    when i browse by artist, and i select the artist, only the songs in the album shows up, all the non-album labeled songs are not visible! the same thing happens when i choose by genre..
    in fact the only way to find those songs not bound to an album is to select them from the song list.. and having to scroll through 7000+ songs to find one really bites..
    curiously enough, if there is two or more albums, then i can find the songs without albums.. definately sounds like a bug to me.. the software for the ipod video is only at v1.0, maybe they'll fix this (hopefully other ipods don't have this problem, i have no way of knowing though).
    one work around i have tried is to set an empty album for the artist's song that has none, but i mean i don't want to do that for all my non-albumed songs because i'm interested in preserving the timestamp of songs (to know when i got them) and i can't reasonably search for songs that have exactly one album to just set those..

    when i go to Music > Artist > All, as you suggested, i see all the albums i have listed. doesn't really relate to my problem with artists with songs in one album, as well as song w/o album set, and the latter not showing up.
    but that reminds me, why is it when i go to the All section from a particular artist and they do have more than one album (or even no albums), the order of the songs is in the order they are in the albums.. if i wanted the order it is on albums, i would have selected that album for example.. it would be nice if the songs were in alphabetical order when you're NOT browsing by album, making a particular song easier to find (what if you have thirteen albums for example and u aren't sure which album a song is on, now you have to scroll through a seemingly random ordered list to find one song, alphabetical would be SOOOO helpful!)

  • Why can't i access my Apps that I downloaded through iTunes. I believe I'm doing something wrong and not that the issue is iTunes itself

    Occasionally ill try downloading an App through my Macbook Pro 13.5 & it directs me to iTunes to be downloaded. So, I go to iTunes and download the App I need. For instance, Amazon. I go into 'My Apps' in iTunes and try clicking on one of my DL Apps, but nothing happens. Why can't I access the Apps, which I downloaded through iTunes.?I believe I'm doing something wrong and not that the issue is iTunes itself.  I have OS X Yosemite 10.10.1. I am due for an upgrade from that software and also an upgrade for iTunes as well, but that shouldn't be the problem. I've tried everything on my end to troubleshoot. I don't really have the time during the day to call in and troubleshoot, so thats why I'm asking the community. Please help with this problem if anyone can. Thank You!

    Once you download an iOS app, you cannot run that app from the computer. That can only be run from an iOS device. You cannot download Mac Apps from the iTunes App Store, those are downloaded from the Mac App Store. Two different places. If you want a Mac app that will run on your Mac, you need to download that from the Mac App Store. iTunes App Store only has iOS apps that work on iOS devices, iPhone, iPad, or iPod.

  • Is this a bug or am I doing something wrong? (Custom Buttons)

    I have a project where I've created a custom buttonbase which has a custom skin.
    Create a button that uses the custom skin which extends the custom button base the first time the button is used it doesn't work the way I would expect.
    Here's what happens. The first time the app is loaded the button's up state shows up just fine. If I mouse over the button it flashes black for a second while it loads the mouse over state. If I mouse out and over again it works normally. Now if I click on the button it flashes black again while it loads the selected state and then the selected over state. After the first time the button functions correctly. But naturally I don't want the button to flash black the first time it's used. I want it to show my custom skin the first time not the second and subsequent times.
    I've included a project that demonstrates the problem. I have added some for loops in the part of the code that determines the custom colors for the button, just so that the black flash is really obvious.
    If you look at it there are three classes. The ButtonSkinBase which defines the base look for all skinned buttons. The ButtonSkin which is a specific skin to use. And the ButtonGraphic which is just a custom definition for a button.
    I think the problem is in the SDK in that it isn't loading the ButtonGraphics in the ButtonSkinBase class before they are used. It loads them when they are used. However, I'm not that experienced with the way the SDK functions under the covers so it could be that I'm not doing something I need to do.
    Any help with this would be great.
    Thanks,
    cdman

    >When you use the includeIn command, by default the object will only be created when it is needed. Hence, you will execute a creationComplete
    >event, and therefore atleast 100 million (sometimes 400 million) loops, when each required Button state is needed. Obviously, once each button
    >state has been created the creationComplete handler (invalidateDisplayList) will not usually be called again.
    So are you saying there is a better way or another way to do that? Or are you just telling me that's how it works? Because I know that the includeIn isn't creating the other buttons untill they are needed. I need them created when the button is created. That is my question, how do I get the other states to be created when the button is created so that I don't see the button flash black?
    >As written, bioStyleChanged will always remain true
    >if(!bioStyleChanged) {
    >       bioStyleChanged = false;
    >}    
    >this code does nothing for you.
    Sorry, I missed that when cleaning up the code to ask for help.
    Thanks,
    cdman52

  • I add apps to my toolbar for the websites I use most frequently, or to remember one that I do not use as ofter. These apps disappear on what used to be a monthly basis, and now more frequently. Am I doing something to cause this?

    I love the feature to pin as app tab on my toolbar. When I first began using this feature, after about a month the toolbar would drop all my apps. I would have to re-add as I used the websites again. Some of my sites I would add because I didn't use them enough to remember them all the time and this was a big help from having to search for a sight all over again. Am I doing something to cause these apps to be dropped? It seems to be happening more frequently now, like every couple weeks. It is annoying to have to keep going back and pinning these sites as app all over again.

    Tks Turingtest2,
    That gives me something to think about.
    Let me tell you a little more of the puzzle which I should have added originally!
    I have about 60 podcasts.  So I want to group those podcasts that I need to download everyday into one "collection" - then at the begiining of the day, I look at the "Every Day" collection of podcasts and then manually down load them.  This way I do not have to look at the other 40 podcasts which are weekly or Monthly podcasts.
    Your script idea will help me with another problem I have (tks!) but I dont think it wil help with this problem!
    I really want to assign something at the "header" level - ie the actual podcast name, rather than the individual daily or weekly or monthly podcasts which is how your script works.
    I think I have found a possible fix by assigning a code (ie "weekly") in the "Composer" field of the podcast and then showing "Composer" in the column browser and then selecting all the weekly ones etc etc.
    I will test this!
    Tks again!

  • Maven dependency mgmt: am I doing something wrong?

    (title shortened to simply not make it too long, not because I am l33t).
    I have a little frustration that only makes me wonder if I am doing something wrong. My general opinion about maven is that it is a great tool that can save a lot of effort managing builds. However, I sometimes find myself traversing down dependency management hell. The source of my problems: transitive dependencies.
    Is it me, or is the maven repository tree polluted? Sometimes I have no other option (that I know of) than adding manual exclusions to my parent poms to filter out transitive dependencies I really do not need, and in some cases even cause conflicts. Now I must say, most of these problems stem from JBoss endorsed projects such as Seam and JBPM.
    If for example I add JBPM 3.3.2 to my application I get Jackrabbit, Lucene and whatever else for "free" with it - I exclude them to keep my dependency tree clean because during runtime these dependencies really are not needed.
    Worse is when I want to use JBoss Seam 2.1.2 (on JBoss 4.2.3, unfortunately I cannot go to a newer JBoss yet) - to be able to do this I must include a dependency org.jboss.el/jboss-el to the project and war, otherwise a single util class cannot be found (grrr). But this dependency transitively adds javax.el / el-api - at compile scope! If this is let slip through and a war is deployed with this dependency present, a classpath isolated environment will give classloader clashes with the classes that the JBoss server itself provides. So I add an exclusion...
    These were just isolated examples and certainly not the only ones I encountered so far. Does anybody else experience these kind of issues? And is there perhaps something obliviously obvious that I am failing to do which would rid me of the need to add manual exclusions? Or am I correct in stating that the repository really is this polluted?

    I've seen that effect, but luckily not to a degree where it got a huge problem. Simply write the necessary excludes when you see such a case and go on. It wasn't necessary too often yet.
    The problem seems to stem from the fact that many Maven artifacts are simply "project X". That means that each and every feature that project X provides is bundled in a single jar which draws in each and every dependency that project X has anywhere.
    The smarter (or at least more maven-friendly) approach would have been to split project X in "project X - core functionality", "project X - lucene search support", "project X - frobnicator" and provide a "project X - everything" module that pulls in all there is for the project.
    This way we could pick only those modules that we need in our dependency and therefore also get only those transitive dependencies that we really need.
    Unfortunately only a few projects have that kind of architecture, so we'll have to live with the excludes for a while.

Maybe you are looking for