Tutorium on basic java usage

Hi all!
I was asked to do a simple java tutorium for some colleagues and I was wondering how to start with it.
I thought about an order like this:
1.) basic OOP thinking (with examples like the well-known tree- or car-example)
2.) basic types (like int, float, double...)
3.) control structure (like while, if...)
4.) Layout of a class
5.) writing a simple Hello World
6.) writing a more complex Hello World with some own classes (maybe an output class or something like that)
7.) some basic GUI stuff like creating an on JFrame with some buttons and a textarea, maybe a lowercase->UPPERCASE converter to provide basic knowledge about events and ActionListeneres
The problem is, this is my first tutorium and I really don't know if this order is a practical one. Mostly it's the way I learned java, so it can't be completly wrong. I hope...
Perhaps anyone with some experience can give me some hints?
Thanks in advance!

Maybe you can get some ideas from the Java TutorialThat was my second thought. :-) I'll go trough the tutorials in the next days, but actually they were not very helpfull to me, when I started with java.
Anyway, good starting point.

Similar Messages

  • 4 basic java questions..

    ok so I already learned Java last year (in grade 11), but my teacher didn't really teach anything, we learnt everything by ourselves from the API... so theres a lot of things I actually don't understand, but for now I want to ask 4 basic questions:
    1. What does static mean?
    2. Why would u "final" a constant variable? ie. If you have a variable called SIZE which is set to 5, so if u want it to be a constant, just never change its value. But what does the keyword final do to it?
    3. What's super? I see it sometimes, and my teacher showed us in the applet exampls to use super.paint(g) or somethign like that for the paint method, but I never use that because I noticed it works fine without it..
    4. Whats a question mark? I saw a game that was made in java and it had a lot of places where it had a question mark , which was part of the syntax. For example,
    int j1 = i != 0 ? i - 1 : 199;
    OR
    JUMPVEL = (fSuperSlime) ? 65 : 31;
    I really don't understand these lines...
    feel free to answer any of these questions...

    wow cool...thanks.. that question mark thing is nice
    saves a few lines..
    now, about super, so u mean u can access the parent
    class's variables?Variables, methods, constructors, if the access level is such that it's allowed.
    This will be covered in any tutorial or text though.
    Sun's basic Java tutorial
    Sun's New To Java Center. Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
    http://javaalmanac.com. A couple dozen code examples that supplement The Java Developers Almanac.
    jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
    JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
    Bruce Eckel's Thinking in Java (Available online.)
    Joshua Bloch's Effective Java
    Bert Bates and Kathy Sierra's Head First Java.
    James Gosling's The Java Programming Language. Gosling is
    the creator of Java. It doesn't get much more authoratative than this.

  • Basic java comparision

    Hi..
    I have a basic JAVA problem..can anyone help on this.
    I have a constant declared in a EMPConstanta.java
    public static String HISTORICAL = "historical";
    In another java class..i need to compare 2 strings..
    String statusType = req.getParameter("historical"); //this vale comes from JSP hidden parameter and the value of statusType is historical
    Now I want to compare with constant vale.. and I am doing like this..
    if(statusType.equals( ASMConstants.HISTORICAL)){
    statusType = ASMConstants.CURRENT;
    Problem is both the values are historical�but it is not entering to if condition..any suggestions

    http://forum.java.sun.com/thread.jspa?threadID=5203921&tstart=0
    avoid multi post

  • Berkeley DB master-slave replication basic java code example

    Hi,
    I am new user of berkeley db and I have limited knowledge of Java programming. Can someone help me with basic Java example code of how to do master-slave replication without elections.
    Thanx,
    Jani

    Hello,
    Please clarify a few points about your program:
    1. What platform and Berkeley DB version are you using?
    2. Are you planning on using the replication framework
    or base replication API for your application?
    3. When you say you want replication without elections,
    what exactly does that mean. For example, if you are using
    the replication framework elections are held transparently
    without any input from your application's code. In this case,
    DB will determine which environment is the master and which
    are replicas. Is that what you are thinking about or
    something else?
    Thanks,
    Sandra

  • Making some basic Java games

    Can anyone help on how to make some basic java games for my website if you could that would be helpful
    thanks,
    Louie

    Well, first of all you program the Framework, add Graphics / sounds / Data , then you put it in your HP - There you are!

  • Knight tour programming with only basic java

    i had this assignment from school which ask us to create a program to calculate how many posssibilities to complete knight's tour from a position using basic java and not using applet. So far i can only create an incomplete program which can only go a speccific way and is also incomplete. i am trying to understand the jaava applet type of knight tour program but got too confused as i have just started learning this. Please help me with this.
    here's my code:
    public class uk16638_a3{
         public static void main(String[] args){
         int horizontal[] = {2,1,-1,-2,-2,-1,1,2};
         int vertical[] = {-1,-2,-2,-1,1,2,2,1};
         int chessBoard[][]=new int[8][8];
         int move, currentRow = 0, currentCol= 0, move_count = 0, new_vert, new_horz;
    for(int i=0; i<8; i++)
         for(int j =0; j<8; j++)
              chessBoard[i][j] = 0;
    chessBoard[0][0] = 1;
    do{
    for(move=0;move<8;move++){
    new_vert = currentRow + vertical[move];
    new_horz = currentCol + horizontal[move];
    if ( (new_vert>=0) && (new_vert < 8) )
    if( (new_horz>=0) && (new_horz < 8) )
    if( chessBoard[new_horz][new_vert]==0 ) {
    chessBoard[new_horz][new_vert] = 1;
    move_count++;
    currentRow = new_vert;
    currentCol = new_horz;
    }}}while(move<8);}}

    Sorry with the inconvenience cause i am new with this forum so i am causing many problems to all of you. here's the full code i put but i would really like to ask someone to teach me on creating a backtrack and let the knight moves following a different sequence from the one i already set.
    public class uk16638_a3{
    public static void main(String[] args){
    //the movements of a knight horizontally and vertically
    int horizontal[] = {2,1,-1,-2,-2,-1,1,2};
    int vertical[] = {-1,-2,-2,-1,1,2,2,1};
    int chessBoard[][]=new int[8][8];
    int move, currentRow = 0, currentCol= 0, move_count = 0, new_vert, new_horz;
    //setting all elements in the array to 0
    for(int i=0; i<8; i++)
    for(int j =0; j<8; j++)
    chessBoard[i][j] = 0;
    //the knight starts here
    chessBoard[0][0] = 1;
    //using do while loop, i try to move the knight following the sequence i had already set in the array above. But because its moving at the same direction all the time, it gets stuck.
    do{
    for(move=0;move<8;move++){
    //setting the new coordinates for it to move to
    new_vert = currentRow + vertical[move];
    new_horz = currentCol + horizontal[move];
    if ( (new_vert>=0) && (new_vert < 8) )
    if( (new_horz>=0) && (new_horz < 8) )
    //new position check if its already occupied or not, if occupied it will move on to the next part of the move sequence i set
    if( chessBoard[new_horz][new_vert]==0 ) {
    chessBoard[new_horz][new_vert] = 1;
    move_count++;
    //current coordinate of the new knight position
    currentRow = new_vert;
    currentCol = new_horz;
    }}}while(move<8);}}
    Edited by: Mikki88 on Mar 2, 2009 1:53 AM

  • Basic Java Class with prints records out of the DEPT table

    Can some one show a basic java class which will query the DEPT table, and print them out?

    Nagarjuna,
    the Oracle DBMS JDBC Developer's Guide is full of code examples.
    http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/toc.htm
    --olaf                                                                                                                                                                                                                                                                                                                       

  • What Mac should I get for basic Photoshop usage?

    I'm hoping to tap into the vast resources/opinions here.
    I'm planning to get a Mac for my office. It will be use primarily for basic Photoshop usage. Maybe making some movies from iPhoto. The other usage would be normal ones like web surfing.
    Please suggest a desktop Mac first, and a laptop Mac 2nd.
    Which Mac model would be most cost-effective and doesn't need upgrading every year?
    Thanks a lot!
    Mavis

    Mavis, the answer to your question really depends on what you mean by 'basic' Photoshop use.
    Bearing in mind that Photoshop has been used by professionals in graphics and design houses for many years, typically working on hardware that is substantially less powerfull than a Mac mini, there is no reason to beleieve that even the entry-level Mac can't sucessfully be used for this kind of work, and those who suggest otherwise simply haven't tried it. However, there are some things that you need to keep in mind when using this software: the first is that Photoshop runs better the more memory you have, the second is that Photoshop files can require large amounts of storage, and the third is that the most recent version tends to place heavy demand on the processor - meaning that the faster the processor the better it runs.
    Thus, any Mac you buy for Photoshop use should ideally be equipped with 1Gb RAM rather than any less. You should also consider getting either the largest internal hard drive you can, or an external firewire drive for extra file storage.
    A Mac mini with 1.42GHz processor and a 1Gb RAM upgrade would certainly be sufficient, even for fairly demanding Photoshop work. The internal 80Gb drive for that model would give you a reasonable amount of space for files, though you would be wise to add a larger external drive too if the work you are doing is at all crucial. The same system would also be capable of your iPhoto work too. If your use is more casual, then the 1.25GHz mini would be enough, but again you'd need the 1Gb RAM upgrade.
    If your intended use is more at the commercial end of Photoshop use, then the chances are that even though a mini would be sufficient, you'd be better with an iMac or G5 tower, simply because for pro-level work, these systems are faster and permit smoother and more productive workflow.
    It also has to be said that no Mac will need upgrading each year, unless your level of use or your needs of that system change dramatically. A system you buy today will remain just as functional into the future. In other words, the best way to minimize the risk of having to upgrade in the forseable future is to work out exactly what you want the system for and buy a system that meets your present (and projected future) needs.

  • Sap basic java libs, JMON, JCO

    Hi,
    Iam applying patch 27 for the portal ep6 sp2. the current patch is ep6 sp2 patch3 with j2ee pl 19.
    Now first iam doing patch 4 for ep6 sp2 and then upgrading to patch 27.
    My question now is for upgrading to patch 4 what version of java libs, jmon and jco i should maintain and later for patch 27 what version of basic java lib, jmon and jco i should maintain.
    The patch4 document says to update basic javalibs, jmon and jco to the latest available one.
    The latest available patches are
    basic java lib - patch 18
    jmon - patch 19
    do anyone know how to do this. any documents are notes available ???
    Thanks for your help in advance
    regards
    Moses

    Hi Moses,
    here is what to you have to do:
    1. Patch the Software Delivery Manager (SDM) to the newest Patch Level (PL 14) - as described in SAP Note 532892
    2. Patch the J2EE Engine to the newest available patch (PL 30) - as described in SAP Note 738921
    3. Patch SAP Basic Java Libs 6.20 to Support Package 18 - as described in SAP Note 544979
    Make sure IRJ service is stopped as mentioned in the thread Basic Java Libs 16
    4. Patch JMON to Patch Level 19. Installation (path were to copy the files) is described in SAP Note 657143. Unfortunately this note is not released. If you don't have a user to see the note, here is in short what you have to do:
    - unzip the archive: "sapcar -xfv JMON_19*.SAR"
    - copy file jmonapi.jar to the following directories:
         - ...j2ee_<Instance_Nr>adminlib
         - ...j2ee_<Instance_Nr>admin     ools
         - ...j2ee_<Instance_Nr>clusterdispatcheradditional-lib
         - ...j2ee_<Instance_Nr>clusterserveradditional-lib
         - ...j2ee_<Instance_Nr>clusterstateadditional-lib
         - ...j2ee_<Instance_Nr>clusterserverservicesfileworklibs
         - ...j2ee_<Instance_Nr>clusterserverstatefileworklibs
    - copy file jmon.dll and sapccmsr.exe to the directory:
         - ...j2ee_<Instance_Nr>os_libs
    5. If needed, patch SAP Java Connector to Service Release 2.0.10 - as described in SAP Note 682686 and the there mentioned installation guide.
    6. Now you can go on patching the Portal first to Patch 4 and than to Patch 27 as described in the installation guides.
    Hope this helps,
    Robert
    PS: Please consider rewarding points to people like Dominik (and me) , who are spending a lot of their time to give helpful replies like in this thread: cross domain SSO-EP6

  • Basic Java Sound Example.

    Hi,
    Can some one give me a basic java sound application( not applet ) to play a wav file.
    Thanks a lot.
    zia

    I did this search
    http://search.java.sun.com/search/java/index.jsp?qp=&nh=10&qt=%2Bplay+%2Bsound+%2Bwav+%2Bapplication&col=jdc&x=14&y=10
    looks like the answer should be there somewhere

  • BI java usage type installation error

    hello everyone,
    Please help me resolve the following:
    Question1
    the system was earlier installed with following usage types:
    -as abap, as java, epc, ep (all on same machine)
    Now i want to addin BI-Java. During the installation I encounter error at phase "Install Java Engine" as follows:
    sapinst.log
    INFO 2009-02-15 03:22:23
    Output of C:\j2sdk1.4.2_12\bin\java.exe -classpath "C:/Program Files/sapinst_instdir/ERP/LM/AS-JAVA/ADDIN/ORA/CENTRAL/CI/install/sharedlib/launcher.jar" -Xmx256m com.sap.engine.offline.OfflineToolStart com.sap.security.core.server.secstorefs.SecStoreFS "
    sapdev/sapmnt/DEV/SYS/global/security/lib/tools/iaik_jce.jar;
    sapdev/sapmnt/DEV/SYS/global/security/lib/tools/iaik_jsse.jar;
    sapdev/sapmnt/DEV/SYS/global/security/lib/tools/iaik_smime.jar;
    sapdev/sapmnt/DEV/SYS/global/security/lib/tools/iaik_ssl.jar;
    sapdev/sapmnt/DEV/SYS/global/security/lib/tools/w3c_http.jar;C:/Program Files/sapinst_instdir/ERP/LM/AS-JAVA/ADDIN/ORA/CENTRAL/CI/install/lib;C:/Program Files/sapinst_instdir/ERP/LM/AS-JAVA/ADDIN/ORA/CENTRAL/CI/install/sharedlib;D:\usr\sap\DEV\DVEBMGS00\exe\ojdbc14.jar" insert -s DEV -f
    sapdev/sapmnt/DEV/SYS/global/security/data/SecStore.properties -k
    sapdev/sapmnt/DEV/SYS/global/security/data/SecStore.key admin/host/DEV sapdev is written to the logfile SecureStoreInsert.log.
    WARNING 2009-02-15 03:22:24
    Execution of the command "C:\j2sdk1.4.2_12\bin\java.exe -classpath "C:/Program Files/sapinst_instdir/ERP/LM/AS-JAVA/ADDIN/ORA/CENTRAL/CI/install/sharedlib/launcher.jar" -Xmx256m com.sap.engine.offline.OfflineToolStart com.sap.security.core.server.secstorefs.SecStoreFS "
    sapdev/sapmnt/DEV/SYS/global/security/lib/tools/iaik_jce.jar;
    sapdev/sapmnt/DEV/SYS/global/security/lib/tools/iaik_jsse.jar;
    sapdev/sapmnt/DEV/SYS/global/security/lib/tools/iaik_smime.jar;
    sapdev/sapmnt/DEV/SYS/global/security/lib/tools/iaik_ssl.jar;
    sapdev/sapmnt/DEV/SYS/global/security/lib/tools/w3c_http.jar;C:/Program Files/sapinst_instdir/ERP/LM/AS-JAVA/ADDIN/ORA/CENTRAL/CI/install/lib;C:/Program Files/sapinst_instdir/ERP/LM/AS-JAVA/ADDIN/ORA/CENTRAL/CI/install/sharedlib;D:\usr\sap\DEV\DVEBMGS00\exe\ojdbc14.jar" insert -s DEV -f
    sapdev/sapmnt/DEV/SYS/global/security/data/SecStore.properties -k
    sapdev/sapmnt/DEV/SYS/global/security/data/SecStore.key admin/host/DEV sapdev" finished with return code 2. Output:
    SAP Secure Store in the File System - Copyright (c) 2003 SAP AG
    A key/value pair with this key already exists in the store.
    ERROR 2009-02-15 03:22:24
    CJS-30051 Cannot insert a key value pair into the secure store fails; see output of log file SecureStoreInsert.log:
    SAP Secure Store in the File System - Copyright (c) 2003 SAP AG
    A key/value pair with this key already exists in the store..
    SecureStoreInsert.log
    SAP Secure Store in the File System - Copyright (c) 2003 SAP AG
    A key/value pair with this key already exists in the store.
    oh and btw...the issue remains with both administrator/devadm
    OR Question 2
    If the above scenario isnt possible, and I performed an uninstall, and after installing all the usage types again, and recovering the database....will i be able to get my integrated BI/ERP client back with it .. or will i have to perform the setup of BI client again ?
    Thanks for your valuable replies.
    Regards,

    First of all... As per SAP Installation guide additional usage type BI installation is POSSIBLE. 
    Please check SAP Note [883948|https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=883948]
    And I guess you have all the primary required components.i.e. ABAP,Java, EP, EPC ...
    Question1
    the system was earlier installed with following usage types:
    -as abap, as java, epc, ep (all on same machine)
    Now i want to addin BI-Java. During the installation I encounter error at
    phase "Install Java Engine" as follows:
    ERROR 2009-02-15 03:22:24
    CJS-30051 Cannot insert a key value pair into the secure store fails; see output
    of log file SecureStoreInsert.log:
    A key/value pair with this key already exists in the store..
    Above error is basically because of JDK and not because of BI
    Please check following blogs...
    [Re: key value pair error;
    [SAPNW2004sJavaSP9_Trial- SecureStoreInsert ERROR;
    SAP Note [1071472|https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1071472]
    As per this... following could be reason.
    1. check that iaik_jce_export.jar file is NOT included into the CLASSPATH.
    2.Use only one JDK version (or remove the other installed versions from the used environment variables).
    3. SAP Note [739043|https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=739043]
    OR Question 2
    If the above scenario isnt possible, and I performed an uninstall,
    and after installing all the usage types again, and recovering the database....
    will i be able to get my integrated BI/ERP client back with it ..
    or will i have to perform the setup of BI client again ?
    I guess It might be difficult to UNINSTALL - may cause some inconsistencies in the current system.
    Still - If you really Don't want BI now... Best option could be full restore and recovery.- If you have consistent backup.
    But if you want BI - then, since above problem is because of JDK , I think it could be resolved.
    Let us know if anything....

  • Basic Java Concepts

    I'm a Java novice, trying to learn it along with Jdeveloper side by side. My learning of the Java fundamental concepts led to the below understanding, please see if my understanding is not correct in any way.
    The fundamental concept with Java is a CLASS, whose feature are its state and behaviour. The state of the class is stored in the definition of the class itself via ATTRIBUTES or in lay man's language VARIABLES. These attributes can be static, public, private or protectd.
    The behaviour of a class is stored via METHODS within the definition of a class. METHOD is nothing but a block of code performaing a certain action.
    A good example of a CLASS's state a behaviour can be a stock. A stocks state is available via its ticker symbol, price of the stock, and the date i.e. on a given date, a given stock has a particular price. So there are 3 attributes.
    Now METHOD in the context of the above example is a means to capture the ever changing state of the above 3 attributes.
    In short attributes or fields ( defined via declaration of variables inside the class) capture the state of an object, where as its interaction with the world external to the object captured by METHOD.
    These 3 attributes are common to thousands of stock's in the outside market, so a common class called STOCK can be created to capture the state and behaviour of thousands of stocks. The same class can be called at the same time to capture the behaviour of N number of stocks. When a class is called as explained, each such call is called an INSTANCE of the CLASS. An OBJECT is an instance of SUCH a class.
    Similar to CLASS is INTERFACE. A given class can only call the attributes and methods from one another class. If a class needs to inherit from more than one another class then it is accomplished via an INTERFACE. An Interface contains only the spec of the methods from other classes and not the entire piece of code for he method itself. The methods that are declared in the interface are implemented in the classes to which they belong to.
    A PACKAGE in turn is a collected of CLASSES and INTERFACES. A PACKAGE helps in keeping the code oraganized and grouped by the functionaliy it delivers.
    A Class can in turn be either a SUPERCLASS or a SUBCLASS. In our given example CLASS, there are some stocks which offer OPTIONS and some which do not. In order to cover that behaviours we will like to create sub class called STOCSKWITHOPTIONS, which will then refer to STOCK class to inherit the attributes and methods from that class. In this case STOCK is the SUPERCLASS, and STOCKOPTIONS is the SUBCLASS.
    Thanks in advance

    Nagarjuna,
    there is an excellent tutorial series from Sun for basic and advanced Java features. It contains a lot of examples and explains every concept. You even download the tutorials.
    See http://java.sun.com/javase/reference/tutorials.jsp
    --olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Help with my basic java

    Hello i am in a high school programming class and i need help. I have to make an application that draws a basic face, and then i put in different scrollbars, drop menus and checkboxes to control how the face works. I have gotten most of what i need to do but i am stuck on, I need to have a so if i press it they will get closer together of farther apart, which is where im stuck. i can only make them move in the same direction. any ideas???
    heres the code.
    import java.awt.*;
    import java.awt.event.*;
    public class Unit9q extends java.applet.Applet implements AdjustmentListener,ItemListener {
         Graphics g;
         Checkbox mybox1,mybox2,mybox3,mybox4,mybox5;
         CheckboxGroup mygroup1,mygroup2;
         Choice mymenubar1,mymenubar2;
         String colorword,shapeword,menuitem1,menuitem2,eyefill,eyesstring;
         Color clr;
         int yaxis,inteyes,ineyes;
         Scrollbar yaxisscroll,eyes;     
         public void init() {
              yaxisscroll=new Scrollbar(0,50,1,120,140);
              yaxisscroll.addAdjustmentListener(this);
              yaxisscroll.setBounds(100,10,100,20);
              add(yaxisscroll);
              yaxis=120;
              eyes=new Scrollbar(0,50,1,120,140);
              eyes.addAdjustmentListener(this);
              eyes.setBounds(100,10,100,20);
              add(eyes);
              inteyes=110;
              mygroup1=new CheckboxGroup();
              mybox1=new Checkbox("Red",mygroup1,false);
              mybox2=new Checkbox("Blue",mygroup1,false);
              mybox3=new Checkbox("Green",mygroup1,false);          
              mybox4=new Checkbox("Filled",mygroup2,false);
              mybox5=new Checkbox("Outlined",mygroup2,false);
              add(mybox4);
              add(mybox5);
              mybox1.addItemListener(this);
              mybox2.addItemListener(this);
              mybox3.addItemListener(this);
              add(mybox1);
              add(mybox2);
              add(mybox3);
              clr=Color.white;
              mymenubar1=new Choice();
              mymenubar1.addItem("Square");
              mymenubar1.addItem("Circle");
              mymenubar1.addItem("Rectangle");
              mymenubar1.addItem("Oval");
              mymenubar1.addItemListener(this);
              mymenubar2=new Choice();
              mymenubar2.addItem("Square");
              mymenubar2.addItem("Oval");
              mymenubar2.addItemListener(this);
              add(mymenubar1);
         public void adjustmentValueChanged(AdjustmentEvent event){
              yaxis=yaxisscroll.getValue();
              inteyes=eyes.getValue();
              repaint();
         public void itemStateChanged(ItemEvent event) {
              menuitem1=mymenubar1.getSelectedItem();
              menuitem2=mymenubar2.getSelectedItem();
              if (mybox1.getState()==true) {clr=Color.red;}
              else if (mybox2.getState()==true) {clr=Color.blue;}
              else if (mybox3.getState()==true) {clr=Color.green;}
              repaint();
         public void paint(Graphics g) {
              g.setColor(Color.black);
              if (menuitem1.equals("Rectangle")){
                   g.drawRect(100,100,70,90);}
              else if (menuitem1.equals("Oval")){
                   g.drawOval(100,100,75,90);}
              else if (menuitem1.equals("Circle")){
                   g.drawOval(100,100,80,80);}
              else if (menuitem1.equals("Square")){
                   g.drawRect(100,100,80,80);}     
              if (menuitem2.equals("Circle")){
                   g.drawOval(80,100,10,10);}
              else if (menuitem2.equals("Square")){
                   g.drawRect(80,100,10,10);}     
                        g.setColor(clr);
              if (mybox4.getState()==true) {
                   g.fillRect(inteyes,120,10,10);
                   g.fillRect(ineyes,120,10,10);}
              else if (mybox5.getState()==true) {
                   g.drawOval(inteyes,120,10,10);
                   g.drawOval(ineyes,120,10,10);}     
              ineyes=inteyes+42;
              g.setColor(Color.black);     
              g.fillOval(128,yaxis,15,22);
              g.drawArc(111,160,50,20,0,180);     
         } //thank you if you can solve it

    Next time you post code, use the CODE button or [code] and [/code] tags so that it maintains the formatting from your editor.
    If two things are moving int the same direction, your adding N to both of their x-coordinates. If you want one to move in one direction and the other in the other direction, then you have to add N to one and -N to the other.

  • Plese help! Stuck on some basic Java homework...

    I am taking this introduction to java class and we were given 3 homework assignments and I am really stuck on 2 of them.
    One of the assignments asks to make a index.html page that will connect to a mysql database for coffee/suppliers.
    The first part says:
    Create the index.html to create the following web page. After a user selects
    Espresso and 5 pounds, and clicks �Submit Order� button, he/she is going to see the
    following URL:
    http://localhost:8080/hmwk09/coffee_processing.jsp?name=Espresso&pounds=5&Submit=Submit+Order
    (which I sort of completed physically with dreamweaver. im not sure if i need to embed some java into that page.)
    The second part which I am really stuck on says:
    Create the coffee_processing.jsp that queries coffees and suppliers table (you created in homework 08) to display the following page:
    This part is where it queries the mysql database that I did. The page is basically supposed to look like this (in a webpage format):
    Here is the information about your order:
    | Name | Supplier | Price |
    | Espresso | The High Ground| 9.99 |
    Number of Pounds: 5
    Total Price: $49.95
    (I really confused on what I need to do to create a jsp to do this. Thanks so much in advance!)

    well, first create a jsp page that defines how the page will look. Then make use of a <jsp:useBean..> in combination with <jsp:getProperty....>
    and <jsp:setProperty....> to access a bean that does the database fetching.

  • Basic Java Program help needed urgently.

    I have posted the instructions to my project assignment on here that is due tomorrow. I have spent an extremely large amount of time trying to get the basics of programming and am having some difficulty off of the bat. Someone who has more experience with this and could walk me through the steps is what I am hoping for. Any Help however will be greatly appreciated. I am putting in a lot of effort, but I am not getting the results I need. Thank you for the consideration of assisting me with my issues. If you have any questions please feel free to ask. I would love to open up a dialogue.
    CIS 120
    Mathematical Operators
    Project-1
    Max possible pts 100
    Write a program “MathOperators” that reads two integers, displays user’s name, sum, product,
    difference, quotients and modulus of the two numbers.
    1. Create a header for your project as follows:
    * Prgrammer: Your Name (1 pt) *
    * Class: CIS 120 (1 pt) *
    * Section: (1 pt) *
    * Instructor: (1 pt) *
    * Program Name: Mathematical Operators (1 pt) *
    * Description: This java program will ask the user to enter two integers and *
    display sum, product, difference, quotients and modulus of the two numbers
    * (5 pts) *
    2. Display a friendly message e.g. Good Morning!! (2 pts)
    3. Explain your program to the user e.g. This java program can add, subtract, multiply,
    divide and calculate remainder of any two integer numbers entered by you. Let’s get
    started…. (5 pts)
    4. Prompt the user- Please enter your first name, store the value entered by user in a
    string variable name. Use input.next() instead of input.nextLine(). (8 pts)
    5. Prompt the user- name, enter first integer number , store the value entered by user in
    an integer variable num1.(5 pts)
    6. Prompt the user- name, enter second integer number , store the value entered by user in
    an integer variable num2.(5 pts)
    7. Display the numbers entered by the user as: name has entered the numbers num1and
    num2.(5 pts)
    8. Calculate sum, product, difference, quotients and modulus of the two numbers. ( 30 pts)
    9. Display sum, product, difference, quotients and modulus of the two numbers. ( 10 pts)
    10. Terminate your program with a friendly message like- Thanks for using my program,
    have a nice day!!(2 pts)

    Nice try. You have not demonstrated that you've at least TRIED to do something. No one is going to do your homework for you. Your "urgency" is yours alone.

Maybe you are looking for

  • Find All Computers with Adobe Flash 12.0.0.77

    I am trying to make a collection with all computers that have Adobe Flash version 12.0.0.77 so that I can do a subselect query but I am getting a syntax error and I don't know why. SELECT SMS_R_SYSTEM.ResourceID, SMS_R_SYSTEM.ResourceType, SMS_R_SYST

  • Printing XML report (with report.xsl stylesheet) shows font colors, but not table highlight colors

    I am trying to print the XML report generated by TestStand to a PDF in order to archive it.  When the XML report is rendered in Internet Explorer, everything looks fine -- Sequence names are highlighted in teal, Pass is in green, Fail is highlighted

  • Reg: Base value in Excise tab in MIGO for imports po

    Hi All. I have a doubt how is the base value claculated in excise tab while doing MIGO for imports PO does this value is picked up from the materila master ?!!!1 regards, Abilash V

  • MM fonts and Macromedia Apps and Tiger

    Hi, I have a problem with macromedia products ( freehand 11.02 and Flash MX 2004) and MM fonts. When I try to convert text to outlines. The bold version of any MM font change to the book version of that font. An example Ocean Sans 768, change to the

  • Can't send emails after the latest upgrade..

    Hi, I have my own email account since updating the system, my emails won't send. I've tried deleting the account anf then adding it back, however it now has taken it off notes, contacts etc It keeps coming up with the same message, 'connection to the