Project for school - I encountered some problems

School gave me and my team a assignment to make a simulation of a floor-robot called Robbie. You can see Robbie as a plotter it is a round robot with a pen that it can turn on or off. The simulation should be of a remote control which gives commands to a class called Robbie.
http://yvo.net/forum/Version16.zip
is what our group made so far.
Our problems are:
-> When Robbie moves, he shocks, I think this has something to do with the paint routines of the underlying Frame. (Frame has a container called World which has a lightweight component called Robbie). We used double buffering, it does not flicker, it shocks.
-> Collision Detection, how should we do Collision Detection between a Wall and a Robbie (Wall can be turned 360 degrees, not just horizontal or vertical). The Robbie to Robbie collision detection works, but could be optimized a lot I think.
-> It is too slow, are their ways to speed up the calculations/smarter repaint? (General Optimization, on school it should run pretty smoothly on a 486).
All the information is in the zip-file and all the source-codes. I use JDK1.4 to compile/run. I noticed that JDK1.3 results in bad repainting. It's a package, the MAIN class is hvu.robbie.gui.MainFrame
All suggestions are welcome, thank you,
Yvo van Beek
[email protected]

Hi,
The thread in RobbieControl should have a sleep
period, instead of having it in the RobbieMove method.
Right now its just calling the robbie-methods all the
time. Actually I dont like that thread at all, think u
should have a thread closer to the paintcalling
methods instead, maybe in robbieMove or just in
Robbie.The problem is, forward should be able to be called manually, like forward(100). Then Robbie should just move the 100 steps, but not too quick (that's why we implemented the pause). We implemented the Thread into the Remote Control, so that the user can keep the button pressed and Robbie will keep on moving AND because the method forward has to return the real number of steps it made, in order to do that (with 2 robbies) is to move the robbie trough the process of calling the method forward, then keep him busy with the moving process and then return. We first tried one Thread for the Remote and another one for moving Robbie. But that became complicated because the first Thread had to wait() in forward and awaken the move Thread, and after moving set the move thread to wait() en notify() the remote control Thread. But you can't force a wait() and notify() so that gave problems.
>
U should probably look at ur doublebuffering. Instead
of doublebuffer the whole 'world' just buffer the
components in it. That way u will avoid that
components isnt fully painted when they move. If doing
that, components-double buffering, u need to repaint
the area where the component have moved from. And u
will need to override some update(Graphics g) methods,
in World and in robbie. They should just call paint.
Ive tried it and the rotating looks much better,
though the movement needs some improvement. I think u
maybe need to override setLocation...Could you maybe give me a bit of code or explain it?
I do not understand the process of container => container => component painting... My emailadress is [email protected] (there you can send source of post it here)
>
I think the collision-detection should be called in
World.moveObject.We will change that, thank you :)
>
Hope theese comment isnt to vague. I will try find
some old code of mine, and compare it with urs.
Stig.Thank you for your help,
Yvo van Beek

Similar Messages

  • [AUDITOR] Class/Method:AuditEngine/finishTransaction encounter some problem

    For getting the roles assigned to a user ,I connect to OIM .I am getting the following exception on executing the operation on the JBOSS console -
    16:04:10,218 WARN [DATABASE] Trying to get the connection count : 4
    16:04:10,218 ERROR [DATABASE] Class/Method: DirectDB/getConnection encounter some problems:
    Error while retrieving database connection.Please check for the follwoing
    Database srever is running.
    Datasource configuration settings are correct.
    16:04:10,234 ERROR [AUDITOR] Class/Method: AuditEngine/finishTransaction encounter some problems: {1}
    java.lang.NullPointerException at com.thortech.xl.util.JDBCUtils.prepareStatement(Unknown Source)
    at com.thortech.xl.dataaccess.tcDataBase.writePreparedStatement(UnknownSource)
    at com.thortech.xl.dataobj.PreparedStatementUtil.executeUpdate(Unknown Source)
    Any pointers as to why this exception occurs will be helpful.
    Thanks !

    user11957197 wrote:
    Hi,
    I am getting this error in my log files when I run our custom Role add schedule task:
    Class/Method: tcReconciliationOperationsBean/ignoreEventAttributeData encounter some problems: Data Not Found.
    BUt with error I cannot figure out where is the problem. Whether the user account is not present in IDM or user role data in not present in Child view data. Please help if anybody have faced such error before.
    Thanks,
    Kalpana.Which OIM version do you work with?

  • HELP! Project for school. What is Apples benefits and costs for consumers?

    I have a project for school, and I'm focusing it around Apple. Ive done hours of research and cant find anything on the benefits and cost for Apples consumers. Help please?

    Macs need almost no IT support, and sometimes none at all. One private educational institution (about 1500 students at all grade levels) with which I have been affiliated a couple years ago decided to equip its students, teachers, and administrators with iPads, iMacs, and MacBook Airs.
    They have no IT staff. Zero.
    Another, fairly large (Fortune 500 company) recently decided to replace all its Windows computers with iMacs and iPads. Less than a year later they laid off 90% of their IT staff, and reduced its associated infrastructure a commensurate amount. This was a benefit I knew would occur, but the C-level suite didn't believe it until seeing it for themselves.
    (Edit to add... Blackberries were the only "supported" mobile device for a long time. iPhones were never supported, yet everyone eventually started using them anyway, even the IT staff. No one even seemed to notice this transition except in hindsight, after which it was already complete. Even today they're not "supported". Yet this business somehow not only managed to survive, it's been growing at a fairly healthy rate despite an awful economic climate.)
    Another educational institution, this time a public one with which I've been more recently affiliated, equips all its students and teachers with MacBook Pros at taxpayer expense. Their reason for doing so was a study concluding that Apple hardware lasts longer, is more resistant to malware and its associated problems, and require less support than PCs.
    Private institutions have always been sensitive to needless costs while institutions relying on public funding have traditionally been less sensitive to that need. That has been changing recently though. Taxpayers, teachers and students all win, of course IT staff has to find other employment for which they're qualified... whatever that may be.
    Of course these amount to nothing more than personal anecdotes, but you can probably find thousands more just like it.

  • UpdateUserData encounter some problems

    Hi All,
    getting a strange error when trying to update a user in OIM. was wondering if anyone has seen this before.
    the gazillion pages of stack trace ends with this.
    =20100311 09:07:10,491 ERROR ExecuteThread: '15' for queue: 'weblogic.kernel.Default' XELLERATE.ACCOUNTMANAGEMENT - Class/Method: tcUserOperationsBean/updateUserData encounter some problems: maoErrors:com.thortech.xl.dataobj.tcUSR could not perform initial select of record 32238.
    And has a bunch of the ones below before it.
    XELLERATE.SERVER - Class/Method: tcTableDataObj/hasColumn encounter some problems: Dataset is not open
    com.thortech.xl.dataaccess.tcDataSetException: Dataset is not open
         at com.thortech.xl.dataaccess.tcDataSet.checkOpen(Unknown Source)
         at com.thortech.xl.dataaccess.tcDataSet.hasColumn(Unknown Source)
         at com.thortech.xl.dataobj.tcTableDataObj.hasColumn(Unknown Source)
         at com.thortech.xl.ejb.beansimpl.tcUserOperationsBean.updateUserData(Unknown Source)
         at com.thortech.xl.ejb.beansimpl.tcUserOperationsBean.updateUser(Unknown Source)
         at com.thortech.xl.ejb.beans.tcUserOperationsSession.updateUser(Unknown Source)
         at com.thortech.xl.ejb.beans.tcUserOperations_voj9p2_EOImpl.updateUser(tcUserOperations_voj9p2_EOImpl.java:1244)
         at com.thortech.xl.ejb.beans.tcUserOperations_voj9p2_EOImpl_CBV.updateUser(Unknown Source)
         at Thor.API.Operations.tcUserOperationsClient.updateUser(Unknown Source)
         at sun.reflect.GeneratedMethodAccessor350.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at Thor.API.Base.SecurityInvocationHandler$1.run(Unknown Source)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.security.Security.runAs(Security.java:41)
         at Thor.API.Security.LoginHandler.weblogicLoginSession.runAs(Unknown Source)
         at Thor.API.Base.SecurityInvocationHandler.invoke(Unknown Source)
         at $Proxy17.updateUser(Unknown Source)
         at com.thortech.xl.webclient.actions.tcManageUserAction.editUser(Unknown Source)
    Thanx
    Fred

    Hi Foresterf,
    Did you make any changes or install updates in your environment before your tests?
    Did you have the sql statements performed before the excpetion? You have to active the logger log4j.logger.XELLERATE.DATABASE = DEBUG.
    The exception below is raised when there is a problem when the dataset executes the sql statement or when the sql statement returns no rows, so this error is because the first one.
    XELLERATE.SERVER - Class/Method: tcTableDataObj/hasColumn encounter some problems: Dataset is not open
    Renato.

  • I am doing Serge Jespers' "elf yourself" video tutorials but I encountered some problems in making it work using AE

    I am doing Serge Jespers' "elf yourself" video tutorials but I encountered some problems in making it work using AE CS4

    Mylenium, thank you for your reply.
    The tutorials can be found at http://sjespers.com/blog/2009/11/13/video-tutorial-elf-yourself-yourself-personalized-vide o-on-the-web/
    My problems are
    1. In AE CS4, the Exported Flash cue points doesn't appear according to Serge's tutorials
    2. In Flash CS4, The created face movie clip doesn't follow according to the cue points as shown in the attached screenshot

  • When I download and install iTunes it looks it does it, but then it never starts, instead gives an error report and says iTunes encountered some problem and has to close

    When I download and install iTunes it looks it does it, but then it never starts, instead gives an error report and says iTunes encountered some problem and has to close

    i don't know how they solved it, i'm having the same problem on Windows XP
    EventType : BEX
    P1 : iTunes.exe
    P2 : 10.7.0.21
    P3 : 504d85d9
    P4 : unknown
    P5 : 0.0.0.0
    P6 : 00000000
    P7 : 08920740
    P8 : c0000005
    P9 : 00000008

  • Microsoft Excel for Windows has encountered a problem and needs to close. W

    i have the attached problem anytime i tried to open a BW query in excel:Microsoft Excel for Windows has encountered a problem and needs to close. We are sorry for the inconvenience", Please inform if there is a work arround, i have re-install excel , likewise SAP many times but nothing

    Hi,
    I would suggest you check with any other colleague if they are able to run the same or not. Running BEx report depends hugely on the front end capacity and performance. Please check if anyone else can run the same report, with the same front end RAM, then it might be the problem with your installation.
    Also you can try with the latest patch for GUI s/w.
    Regards,
    Debasis.

  • It works!!! ITunes is now loaded!  For "...Encountered a problem" errors

    After 4 days of working on this non stop, I have finally got it! Thanks to all of you posting the wonderful tips!
    I will tell you what I did. I am not sure which of these steps was the trick, since I did this so many times. But there are two things that I did differently this last time, which I mention below. I think those did the trick!
    1) Under "Trouble installing iTunes or QuickTime software in Windows" on Apple Support for iTunes (http://docs.info.apple.com/article.html?artnum=93976) do ALL of the steps under "Completely Remove iTunes and QuickTime". Please note: For step #16, when it talks about removing files in C:/Windows/System32, make sure you remove folders AND files. The first time I did this, I only removed the Itunes, Ipod and Quicktime folders. I did not scroll all the way down to just the independent files, there were a few more Quicktime files there.
    2) Additionally, I went to My Computer, and went under C:/Program files and deleted the folders there too.
    3) (optional?) I wanted to at least get one program working right first (neither my iTunes or QT were working, I was getting the error "iTunes/Quicktime has encountered a problem..." So after I completed the above steps, I went to this site and downloaded QT by itself first, and made sure it was working properly before I proceeded. This may have had nothing to do with it, but wanted to share my exact steps that I did.
    4) Downloaded iTunes + Quicktime again. I THINK THIS NEXT PART WAS WHAT DID IT: This worked for someone else yesterday who posted it, so I tried this too. I think that, for whatever reason, this was a key. When you get to the part where it asks you what folder to load it into, instead of defaulting into C:/Program Files/iTunes, I installed it directly onto C. So, that would be C:/iTunes. I did the same for QT on step #3 above.
    It now works, and my 10 yr old is a happy camper, and I get to tackle something else tomorrow, since I have spent 4 days on this! Thank you so much to all of you who posted tips to help!
    April

    See my post on 12/27 entitled "It works!..." for a detailed description on the fix.

  • Help with a project for school

    This is the code that I came up with. The assignment for school said to edit the code I came up with for a program that will tell you the total pay with regular hours and overtime hours combined. Now we have to edit it using methods. I tried my best for the last 4 hours or so trying to figure this out but I need help because I can't figure this out. There is an error in the General Output that says "java.lang.NoClassDefFoundError: MethodsOne
    Exception in thread "main"
    Process completed." I cant figure out how to get rid of that. Other than that I cant seem to get it to do anything else that I would like it to do, like the actual calculations to get the final answer. Any helpful input on how to fix it would be awesome! Thanks!
    import TerminalIO.*;
    public class MethodsOne {
         private static String emp;
         private static double rate;
         private static int hours;
         private static int overtime;
         private static double overtimehours;
    public static void main(String Args[])
         stateEmpId();
           stateRate();
           calcHours();
           calcOvertime();
           calcOvertimeHours();
           calcEntirePay();     
         public static void stateEmpId()
              System.out.print ("Enter Employee ID: ");
              emp = reader.readLine();
           public static Void stateRate()
              System.out.print ("Enter Employee Hourly Wage: ");
              rate = reader.readDouble();
         public static Void calcHours()
              System.out.print ("Enter Employee Weekly Hours: ");
              hours = reader.readInt();
         public static void calcOvertime()
              System.out.print ("Enter Employee Overtime Hours: ");
              overtime = reader.readInt();
         public static void calcOvertimehours()
              overtimehours = ((1.5 * calcOvertime + CalcHours) * (StateRate));
         public static void calcEntirePay()
         System.out.println ("Your Total Pay for the week is:$ ");
         System.out.print (overtimehours);
    }Edited by: AndyB5073 on Nov 10, 2007 2:51 PM

    hi, sorry for my english. I�m change your source because you have problem to read to standar input (console). I wrote coments. bye good luck
    import java.io.IOException;
    public class MethodsOne {
         private static String emp;
         private static double rate;
         private static double hours;
         private static double overtime;
         private static double overtimehours;
    public static String inputRead() {
         byte buff[] = new byte[80]; // length line console
         try {
              System.in.read(buff,0,80);
         } catch (IOException e) {
              System.out.print ("input text length highest 80 ");
              // TODO Auto-generated catch block
              e.printStackTrace();
         return new String(buff);
    public static void main(String args[])
         stateEmpId();
           stateRate();
           calcHours();
           calcOvertime();
           calcOvertimeHours();
           calcEntirePay();     
         public static void stateEmpId()
              System.out.println ("Enter Employee ID: ");
              emp = inputRead();
           public static  void stateRate()
              System.out.println ("Enter Employee Hourly Wage: ");
              String tmp = inputRead();
              rate = Double.parseDouble(tmp);
         public static void calcHours()
              System.out.println ("Enter Employee Weekly Hours: ");
              String tmp = inputRead();
              hours = Double.parseDouble(tmp);
         public static void calcOvertime()
              System.out.println ("Enter Employee Overtime Hours: ");
              String tmp = inputRead();
              overtime = Double.parseDouble(tmp);
         public static void calcOvertimeHours()
              // overtimehours = ((1.5 * calcOvertime + CalcHours)* (StateRate));
              // bad --- dont use this methods: They are called in the main. Uses local variable
              overtimehours = ((1.5 * overtime + hours)* rate);
              // good --- using local variables
         public static void calcEntirePay()
         System.out.println ("Your Total Pay for the week is:$ ");
         System.out.print (overtimehours);
    }

  • A blank jsf encountered some problems

    hi
    All.
    I deployed a blank jsf application,but encountered some exceptions.
    The application 's download url is
    http://www.coreservlets.com/JSF-Tutorial/code/jsf-blank-myfaces-app.zip.
    Thanks for your help.
    Best regards.
    ===================================================
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Servlet.init() for servlet Faces Servlet threw exception
         org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
         org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
         org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
         org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
         org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
         java.lang.Thread.run(Unknown Source)
    root cause
    java.lang.IllegalStateException: No Factories configured for this Application. This happens if the faces-initialization does not work at all - make sure that you properly include all configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions!
    If you did that and find nothing, the mistake might be due to the fact that you use some special web-containers which do not support registering context-listeners via TLD files and a context listener is not setup in your web.xml.
    A typical config looks like this;
    <listener>
    <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
    </listener>
         javax.faces.FactoryFinder.getFactory(FactoryFinder.java:93)
         javax.faces.webapp.FacesServlet.init(FacesServlet.java:91)
         org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
         org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
         org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
         org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
         org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
         java.lang.Thread.run(Unknown Source)
    note The full stack trace of the root cause is available in the Apache Tomcat/6.0.10 logs.
    Message was edited by:
    SpaceOfFrank

    hi
    All.
    I deployed a blank jsf application,but encountered some exceptions.
    The application 's download url is
    http://www.coreservlets.com/JSF-Tutorial/code/jsf-blank-myfaces-app.zip.
    Thanks for your help.
    Best regards.
    ===================================================
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Servlet.init() for servlet Faces Servlet threw exception
         org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
         org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
         org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
         org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
         org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
         java.lang.Thread.run(Unknown Source)
    root cause
    java.lang.IllegalStateException: No Factories configured for this Application. This happens if the faces-initialization does not work at all - make sure that you properly include all configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions!
    If you did that and find nothing, the mistake might be due to the fact that you use some special web-containers which do not support registering context-listeners via TLD files and a context listener is not setup in your web.xml.
    A typical config looks like this;
    <listener>
    <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
    </listener>
         javax.faces.FactoryFinder.getFactory(FactoryFinder.java:93)
         javax.faces.webapp.FacesServlet.init(FacesServlet.java:91)
         org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
         org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
         org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
         org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
         org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
         java.lang.Thread.run(Unknown Source)
    note The full stack trace of the root cause is available in the Apache Tomcat/6.0.10 logs.
    Message was edited by:
    SpaceOfFrank

  • A project for school-once it was done-I had to add a few videos-problems

    I was doing a birthday DVD for one of my teachers using FCE, we used the school photos and used the computer for audio for each student to say or sing happy birthday.
    Once it was done, we realized , we forgot two students. I went back and every time I added the pic, then the audio, it messed up my timeline.
    Sometimes, it cut into someone else photo or completely eliminated it and the audio of others were out of sync. Because of the time deadline, I had to apologized to the two students. If I had more time I would have probably figured it out.
    In hindsight, I should have locked the audio and added the photos, maybe that would have help. Also, I wanted to move one clip to another location and ran into problems doing that. I remember in imovie, you drag the clip to a new location and all the other clips move and accommodated the clips. In FCE, everything got out of whack.
    For next time, what is the best way to do this, especially once is done and you have to go back to the timeline and make adjustments?

    stingray_on wrote:
    Sometimes, it cut into someone else photo or completely eliminated it and the audio of others were out of sync.
    If you want to edit it in between other clips, you should use the INSERT edit. You might have used overwrite by accident.
    Also, I wanted to move one clip to another location and ran into problems doing that. I remember in imovie, you drag the clip to a new location and all the other clips move and accommodated the clips. In FCE, everything got out of whack.
    In the timeline, for having the rest of the clips "ripple" down to accomodate the edit, you could first copy the clip, then do a ripple delete (shift-delete). Then you could Paste-insert it (shift-V) where you wanted to move it to.
    Message was edited by: skalicki`

  • Final project for school

    Ok, hi. I'm new here and I would like some help on things I don't know how to do with java. I'm creating a java RPG game, respectfully named RPG, and I need some help on these things:
    1.) A random number generator. This is needed to apply "level up" stats for attack and defence scores. I have looked online for the script for a random number generator and I couldn't understand it for the love of me. I would like it to be a 'int' varable (yes, i know the script for the RNG is a 'double' varable, but you can use Math.round to round the 'double' varable to a number a 'int' varable can hold) and seperated for attack and defence (I'm thinking that you can just call the RNG method again, but I'm not sure).
    2.) A "map", so-to-say. I need a script for a map because whats an RPG without a map? I've tried writing the map code with no prevail. I really need it to be a number-type system with the varables x_move and y_move. I think the upper-left hand corner is 0,0 and it adds 1 to x_move if you move right and subtracts 1 from x_move if you move left. The problem that I ran into is that it would go into negitive numbers, thus crashing the game because it would look for, lets say -1,4, and then, when not found, will crash. I've tried setting the "north" button visibility to false when you couldn't move any farther up, but it still managed to to go negitive from time to time.
    3.) Saving/loading the game. I already have a working code for this, but I would like whatever is saved, like numbers, in a number format, like int. I've written the code like this:
    atk_str.writeInt()
    // atk_str ISN'T a String, it's an Int varable. str means strengthand it would output insainly large numbers, like 192830249328. So currently I have everything saved as a UTF (String) and it seems that everything runs fine
    Thanks

    Oh... my... god...
    I figured out why my buttons weren't working right... and it didn't have anything to do with my if statements...
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    public class TrivialApplication extends Frame implements ActionListener
    static DataInputStream input; //File Input Code
    static DataOutputStream output; //File Output Code
    ConfirmBox exit_confirm = new ConfirmBox(this, "Exit", "Do you really want to exit?");
    MessageBox read_error = new MessageBox(this, "Error", "The selected File was not found.");
    MessageBox read_error_2 = new MessageBox(this, "Error", "The selected File could not be Read.");
    MessageBox read_success = new MessageBox(this, "Success", "File Loaded Successfully.");
    MessageBox write_error_1 = new MessageBox(this, "Error", "The File could not be Found.");
    MessageBox write_error_2 = new MessageBox(this, "Error", "The File cound not be Written.");
    MessageBox write_success_1 = new MessageBox(this,"Success", "The Game was Saved Successfully.");
    MessageBox write_success_2 = new MessageBox(this,"Success", "The Game was Created Successfully.");
    MessageBox name_error = new MessageBox(this, "Error", "No File selected.");
    //Main Window variables
    static Panel item_panel = new Panel();
    static Panel button_panel = new Panel();
    static Button north_btn = new Button("NORTH");
    static Button south_btn = new Button("SOUTH");
    static Button east_btn = new Button("    EAST    ");
    static Button west_btn = new Button("    WEST    ");
    static Panel stats_panel = new Panel();
    static TextField stats_txf = new TextField(30);
    static Button stats_btn = new Button("Save Game");
    static Button stats_btn2 = new Button("Load Game");
    static Panel load_panel = new Panel();
    static TextField load_txf = new TextField(20);
    static Button load_btn = new Button("Load");
    static Button create_btn = new Button("Create");
    static String version = "0.8.0a";
    static String file_name;
    static String title = "RPG "+version;
    int x;
    int y;
    boolean N = true; //North Boolean
    boolean S = true; //South Boolean
    boolean E = true; //East Boolean
    boolean W = true; //West Boolean
    boolean UP = false; // North Boolean2
    boolean DOWN = false; //South Boolean2
    boolean LEFT = false; //West Boolean2
    boolean RIGHT = false; //East Boolean2
    //Game File variables
    static String ver_nbr;      //Game File version
    static String level;     //Character level
    static String cur_HP;
    static String max_HP;
    static String atk_str;
    static String def_str;
    static String cur_exp;
    static String exp_ned;
    static String loc_x; //Map Location(x)
    static String loc_y; //Map Location(y)
    public static void main(String[] args)
    TrivialApplication window = new TrivialApplication();
    window.setTitle(title);
    window.setSize(500,250);
    window.setVisible(true);
    public TrivialApplication()
    Setup(); //sets up the panels
    ButtonPanel();
    setLayout(new BorderLayout());
    setBackground(Color.green);
    add(button_panel, BorderLayout.SOUTH);
    load_txf.requestFocus();
    load_btn.addActionListener(this);
    create_btn.addActionListener(this);
    add(stats_panel, BorderLayout.NORTH);
    stats_btn.addActionListener(this);     //Save button
    stats_btn2.addActionListener(this); //Load button
    addWindowListener(
    new WindowAdapter()
    public void windowClosing(WindowEvent e)
    exit_confirm.setVisible(true); //Works
    public void Setup() //Sets up the main window
    load_panel.add(create_btn);
    load_panel.add(load_txf); //Game Name TextField
    load_panel.add(load_btn);
    stats_panel.add(stats_btn2);
    stats_panel.add(stats_txf);
    stats_txf.setEditable(false);
    stats_panel.add(stats_btn);
    return;
    public void ButtonPanel()
    //This peice of code is what was messing up my directional buttons...
    button_panel.setLayout(new BorderLayout());
    button_panel.add(north_btn, BorderLayout.NORTH);
    north_btn.addActionListener(this);
    north_btn.setVisible(N);
    button_panel.add(south_btn, BorderLayout.SOUTH);
    south_btn.addActionListener(this);
    south_btn.setVisible(S);
    button_panel.add(east_btn, BorderLayout.EAST);
    east_btn.addActionListener(this);
    east_btn.setVisible(E);
    button_panel.add(west_btn, BorderLayout.WEST);
    west_btn.addActionListener(this);
    west_btn.setVisible(W);
    button_panel.add(load_panel, BorderLayout.CENTER);
    return;
    public void Load() //Load Script
    file_name = load_txf.getText(); //Gets the File Name
    try
    input = new DataInputStream(new FileInputStream(file_name+".dat"));
    catch(IOException ex)
    read_error.setVisible(true);
    try
    ver_nbr = input.readUTF();
    level = input.readUTF();
    cur_HP = input.readUTF();
    max_HP = input.readUTF();
    atk_str = input.readUTF();
    def_str = input.readUTF();
    cur_exp = input.readUTF();
    exp_ned = input.readUTF();
    loc_x = input.readUTF();
    loc_y = input.readUTF();
    catch(IOException c)
    read_error_2.setVisible(true);
    Check(); //The Check script
    Map(); //The Map Script
    stats_txf.setText("X: " + x + " Y: "+y); //Debug
    //stats_txf.setText("Lvl: "+level+" Health: "+ cur_HP +"/"+ max_HP+"   Exp: "+cur_exp+"/"+exp_ned);
    load_panel.setVisible(false);
    return;
    public void Save() //Save Script
    try
    output = new DataOutputStream(new FileOutputStream(file_name+".dat"));
    catch(IOException ex)
    write_error_1.setVisible(true);
    try
    output.writeUTF(ver_nbr);
    output.writeUTF(level);
    output.writeUTF(cur_HP);
    output.writeUTF(max_HP);
    output.writeUTF(atk_str);
    output.writeUTF(def_str);
    output.writeUTF(cur_exp);
    output.writeUTF(exp_ned);
    output.writeUTF(loc_x);
    output.writeUTF(loc_y);
    catch(IOException c)
    write_error_2.setVisible(true);
    write_success_1.setVisible(true);
    return;
    public void Check() //This should check if the current experence is over experence needed
    //Seems to work now...
    //May add a FileVersionCheck
    int cur_exp_chk = Integer.parseInt(cur_exp);
    int exp_ned_chk = Integer.parseInt(exp_ned);
    if (cur_exp_chk >= exp_ned_chk)
    LevelUp();
    else
    return;
    public void Create() //coded 4/12/2006
    file_name = load_txf.getText();
    ver_nbr = "2.1.0";
    level = "1";
    cur_HP = "10";
    max_HP = "10";
    atk_str = "10";
    def_str = "10";
    cur_exp = "0";
    exp_ned = "100";
    loc_x = "0";
    loc_y = "0";
    try
    output = new DataOutputStream(new FileOutputStream(file_name+".dat"));
    catch(IOException ex)
    write_error_1.setVisible(true);
    try
    output.writeUTF(ver_nbr);
    output.writeUTF(level);
    output.writeUTF(cur_HP);
    output.writeUTF(max_HP);
    output.writeUTF(atk_str);
    output.writeUTF(def_str);
    output.writeUTF(cur_exp);
    output.writeUTF(exp_ned);
    output.writeUTF(loc_x);
    output.writeUTF(loc_y);
    catch(IOException c)
    write_error_2.setVisible(true);
    write_success_2.setVisible(true);
    return;
    public void MapSetup()
    x = Integer.parseInt(loc_x);
    y = Integer.parseInt(loc_y);
    return;
    public void Map() //Coded 4/11/2006
    //Works
    //Going to remove soon... no need for it anymore
    if(UP == true)
    x = x - 1;
    UP = false;
    else
    if(DOWN == true)
    x = x + 1;
    DOWN = false;
    else
    if(LEFT == true)
    y = y - 1;
    LEFT = false;
    else
    if(RIGHT == true)
    y = y + 1;
    RIGHT = false;
    //Checks the X location
    //Works
    if(0 < x && x < 10)
    N = true;
    S = true;
    else
    if(0 < x && x >= 10)
    x = 10;
    N = true;
    S = false;
    else
    if(0 >= x)
    x = 0;
    N = false;
    S = true;
    //Checks the Y location
    //Works
    if(0 < y && y < 10)
    E = true;
    W = true;
    else
    if(0 < y && y >= 10)
    y = 10;
    E = false;
    W = true;
    else
    if(0 >= y)
    y = 0;
    E = true;
    W = false;
    //The *improved* button code
    north_btn.setVisible(N);
    south_btn.setVisible(S);
    east_btn.setVisible(E);
    west_btn.setVisible(W);
    loc_x = ""+x;
    loc_y = ""+y;
    stats_txf.setText("X: " + x + " Y: "+y); //Debug
    //Save Script
    try
    output = new DataOutputStream(new FileOutputStream(file_name + ".dat"));
    catch(IOException ex)
    write_error_1.setVisible(true);
    try
    output.writeUTF(ver_nbr);
    output.writeUTF(level);
    output.writeUTF(cur_HP);
    output.writeUTF(max_HP);
    output.writeUTF(atk_str);
    output.writeUTF(def_str);
    output.writeUTF(cur_exp);
    output.writeUTF(exp_ned);
    output.writeUTF(loc_x);
    output.writeUTF(loc_y);
    catch(IOException c)
    write_error_2.setVisible(true);
    return;
    public void LevelUp() //coded 4/11/2006
    //Level Script
    int level_gain = Integer.parseInt(level);
    level = ""+ (level_gain+1);
    //Experence Script
    double exp_gain = (Math.random()*2+1);
    int exp_ned_temp = Integer.parseInt(exp_ned);
    exp_ned = ""+ Math.round(exp_ned_temp*exp_gain);
    //Attack Script
    double atk_gain = (Math.random()*5+1);
    int atk_str_temp = Integer.parseInt(atk_str);
    atk_str = ""+ Math.round(atk_str_temp + atk_gain);
    //Defence Script
    double def_gain = (Math.random()*5+1);
    int def_str_temp = Integer.parseInt(def_str);
    def_str = ""+ Math.round(def_str_temp + def_gain);
    //HP Script
    double HP_gain = (Math.random()*8+1);
    int HP_max_temp = Integer.parseInt(max_HP);
    int HP_cur_temp = Integer.parseInt(cur_HP);
    max_HP = ""+ Math.round(HP_max_temp + HP_gain);
    cur_HP = ""+ Math.round(HP_cur_temp + HP_gain);
    //Save Script
    try
    output = new DataOutputStreamnew FileOutputStream(file_name + ".dat"));
    catch(IOException ex)
    write_error_1.setVisible(true);
    try
    output.writeUTF(ver_nbr);
    output.writeUTF(level);
    output.writeUTF(cur_HP);
    output.writeUTF(max_HP);
    output.writeUTF(atk_str);
    output.writeUTF(def_str);
    output.writeUTF(cur_exp);
    output.writeUTF(exp_ned);
    output.writeUTF(loc_x);
    output.writeUTF(loc_y);
    catch(IOException c)
    write_error_2.setVisible(true);
    return;
    public void actionPerformed(ActionEvent e) //Updated 4/19/2006
    String arg = e.getActionCommand();
    if(arg == "Load")
    if (load_txf.getText().compareTo("")<1)
    name_error.setVisible(true);
    else
    Load();
    if(arg == "Create")
    if (load_txf.getText().compareTo("")<1)
    name_error.setVisible(true);
    else
    Create();
    MapSetup();
    if(arg == "Load Game")
    load_panel.setVisible(true);
    if(arg == "Save Game")
    Save();
    //The Direction Buttons
    //Works
    if(arg == "NORTH")
    UP = true;
    DOWN = false;
    LEFT = false;
    RIGHT = false;
    arg = "";
    Map();
    else
    if(arg == "SOUTH")
    UP = false;
    DOWN = true;
    LEFT = false;
    RIGHT = false;
    arg = "";
    Map();
    else
    if(arg == "    EAST    ")
    UP = false;
    DOWN = false;
    LEFT = false;
    RIGHT = true;
    arg = "";
    Map();
    else
    if(arg == "    WEST    ")
    UP = false;
    DOWN = false;
    LEFT = true;
    RIGHT = false;
    arg = "";
    Map();
    else
    return;
    }gha... thats a lot of code... But the directional buttons work the way they should. apparently, calling ButtonPanel() while inside the Map() script caused the computer to read the Map() script twice, adding 2 + x each time a button was pressed (note, if x = 2, then it would add 2 but take away 4 if another button was pressed)
    version 0.8.1a will implement the new(er) button code, so it doesn't take up so much room. I don't know if I want to change the random Number Generators i have in my script... they have been good to me and take up a lot less space then the Random() script would have.
    so, now, my next project is the monster script (yay). I don't know in god's name i would be able to do that, but i'll try... Im thinking that I may use mon_x = Math.round(Math.random(mon_x_temp)*10); to figure out the Monsters X & Y cords, but the attacking script and the damage script will be uber hard to do...
    Well, intill next time...

  • The fix for "iTunes has encountered a problem and needs to close . . ."

    I recently purchased a new laptop and tried to get my library transferred. iTunes wouldn’t open; QuickTime wouldn’t open. I was near a heart attack. I tried the fixes listed in the forum, but they didn’t work. Then I discovered:
    The fix needs to be done in a proper order!
    a. Delete iTunes and QuickTime from Add/Remove programs
    b. Go to C > Program files an delete the folders for iTunes and QuickTime. If QT will not allow you to delete the program because it’s “in use”, then go to Start > Run > configsys > Startup and deselect “qttask”. You will have to reboot and get past the selective start up/diagnostic screen. Then go back to C > Program files and you will now be able to delete the QuickTime folder.
    c. For good order’s sake, delete any desktop shortcuts and empty your Recycle Bin.
    d. Reboot
    e. Download the STAND ALONE version of QuickTime: http://www.apple.com/quicktime/download/standalone.html
    f. Install the stand alone version; reboot
    g. Download the QuickTime 7 with iTunes 6: http://www.apple.com/quicktime/download/win.html
    h. Install the iTunes program. The stand alone will take precedence over the imbedded version of QuickTime.
    i. Reboot
    When your system has completed the reboot, you should be able to double-click the newly installed desktop shortcut; give it a few minutes and it should open. Mine did – and I tried everything else. If this does NOT work, then there is a conflict with something else in your system and you will have to go through the configsys elimination process, which is a whole lot more work.
    Best of luck!
    Gateway laptop Windows XP

    The first thing to check is Quicktime as iTunes will not work without it.
    Does Quickime launch OK and work normally?
    If it does use the method in this article to troubleshoot iTunes:
    http://support.apple.com/kb/TS1421
    If QUicktime does not launch, describe what happens with any error message in full.
    Have you installed any of the following:
    ACE & K-Lite mega codecs package, QT alternative, Storm codec, WinAVI video converter, Mpcstar, (possibly starcodec pack, 3ivx)
    If so uninstall them, they are know to cause problems with QUickitme.
    Then download the version of Quickime without iTunes (it is not the default option):
    http://www.apple.com/quicktime/download/win.html
    Now Remove Quicktime using the method for Quicktime in this article (just Quicktime):
    XP
    http://support.apple.com/kb/HT1925
    Vista
    http://support.apple.com/kb/HT1923
    When you come to your C:\Windows\system32\ folder you can delete any file or folder with Quicktime in the name.
    Restart you computer
    Install the stand alone Quicktime and check if it starts.
    If it does you are in a position to find out if iTunes is OK.

  • I am a student working on a project for school and I need to know the bandwidth options for the iPad mini with retina display

    I am working on a project where I am required to introduce a new product for consideration in the hospital setting.  I have chosen the iPad mini, and have been able to locate the information that I need except for the bandwidth options.  Any help would be appreciated.

    I don't know what you mean by "bandwidth options". If you mean the frequencies and bands the iPad can use with cell carriers, those are listed in the Wireless and Cellular area of the tech specs. For iPads sold in the US, see:
    http://www.apple.com/ipad-mini/specs/
    If that's not what you meant, please post back and clarify what you mean by "bandwidth options".
    Regards.

  • This is the fix for "iTunes has encountered a problem and needs to close .

    I recently purchased a new laptop and tried to get my library transferred. iTunes wouldn’t open; QuickTime wouldn’t open. I was near a heart attack. I tried the fixes listed in the forum, but they didn’t work. Then I discovered:
    The fix needs to be done in a proper order!
    a. Delete iTunes and QuickTime from Add/Remove programs
    b. Go to C > Program files an delete the folders for iTunes and QuickTime. If QT will not allow you to delete the program because it’s “in use”, then go to Start > Run > configsys > Startup and deselect “qttask”. You will have to reboot and get past the selective start up/diagnostic screen. Then go back to C > Program files and you will now be able to delete the QuickTime folder.
    c. For good order’s sake, delete any desktop shortcuts and empty your Recycle Bin.
    d. Reboot
    e. Download the STAND ALONE version of QuickTime: http://www.apple.com/quicktime/download/standalone.html
    f. Install the stand alone version; reboot. At this time, when the diagnostic window comes up, you can reselect “qttask”
    g. Download the QuickTime 7 with iTunes 6: http://www.apple.com/quicktime/download/win.html
    h. Install the iTunes program. The stand alone will take precedence over the imbedded version of QuickTime.
    i. Reboot
    When your system has completed the reboot, you should be able to double-click the newly installed desktop shortcut; give it a few minutes and it should open. Mine did – and I tried everything else. If this does NOT work, then there is a conflict with something else in your system and you will have to go through the configsys elimination process, which is a whole lot more work.
    Best of luck!

    Generate another of those error messages and click the "Click here" link in the error message box. What modname and modver are showing for the error? (Precise spelling please.)
    If the error is a BEX and thus doesn't show an modname or modver, let us know what P1 through P9 items are showing for you instead.

Maybe you are looking for

  • Battery or board?

    I have a Powerbook G4 that's about 5-6 years old. I replaced the hard drive two years ago, and participated in Apple's battery replacement program four years ago and the adapter was replaced about three years ago. Here's the issue: Recently when I bo

  • Auto-Suggest feature in Combo-box LOV is not displaying non-unique values

    Hi, I have an auto-suggest feature implementation on a combo-box lov that displays the name and email-id of a list of people. There are non-unique names in the back-end, for example : Abraham Mason [email protected] Abraham Mason [email protected] Bu

  • Looking for LabVIEW & TestStand work in the Dallas/Fort Worth area.

    I am currently working in the Arlington, Tx. My contract will be up in mid September. I am wanting to stay either in the Dallas/Fort Worth area or in the southern U.S. Please view my resume if you are interested. Thank you Warren Arnold Attachments:

  • Can't import ISO Files in VM Manager because of empty Server Pool Drop Down

    Hello, I have the problem I can't import ISO files to my ressources because in the import mask the Server Pool Name Drop Down is empty. In the Virtual Machine Templates mask the Server Pool Name is available and I have already one VM running with a o

  • Restore-SBFarm - How to make this work?

    Hi, I've read through some docs on the restore-sbfarm cmdlet, which according to Microsoft does the same as new-sbfarm except with existing databases (full of data one would assume). Restore-SBFarm I have tried to do this, but I keep running into an