Need help to explain these codes!!! Urgently!!!

Hi anyone who's here to help...I am doing my Final year project report now...i dunno how to explain these codes in word...can anyone tell me what it means? what are these codes for...? what does each paragraph indicate?
thanks.
sorry, maybe i only insert pieces of the codes and its vague...ok, in this source code...what i dun understand is....i have cut and paste the sections of codes which i dun understand as below..
bcoz this codes are passed down from my seniors who had graduated...and my task is to explain these codes in the form of a report without me having any background on programming...i tried asking some frens...its either they dunno or forgotten...this is my last hope...thanks again...thanks..
* new added code */
     Thread scroller;     //for looping purpose
     int loopcounter,count;
     // thread is to allow the program to be called every and then.
     public void init()
          /*new added code */
          loopcounter=0;[list]
**like whats does "thread scroller" means? Looping purpose? what's looping then?
**also, i've tried on changing the "Loopcounter = 0" to other numbers like 2 and 5...and when i run it on the appletviewer..my image simply runs out of my page...
[list]
*And this part...what does it mean?
/*new added code*/                                      
            public void start() {                    
            if (scroller == null) {               
            scroller = new Thread(this);         
            scroller.start();                          
    } [list]
for this section here, i really dunno what it says.. "public void start"--start what? scroller again? new Thread(this)?
[list]
    public void stop() {    
        if (scroller != null) { 
            scroller.stop();   
            scroller = null; 
    } [list]
I dunno about this section also.. stops wat??
[list]
    public void run() {                                                           
          try {Thread.currentThread().sleep(100);}                
            catch (InterruptedException e){}
        for (count=0; count <= 400; ) {  
          try {Thread.currentThread().sleep(20);} 
            catch (InterruptedException e){}  
          rm.load();       
    } [list]
wat is it runing here? try? catch? for? wat does it mean?????
[list]
    public void destroy(){;}                  
    public void update(Graphics g){paint(g);}
}[list]
now this.. wat is it destroying?? updateing wat???
[list]
this is my whole program like...
import java.awt.*;     /*Contains all of the classes for creating user
               interfaces and for painting graphics and images.*/
import java.applet.*;     /*Provides the classes necessary to create an applet and the
               classes an applet uses to communicate with its applet context.*/
/* Loadable is required for RealMedia so that it know that this code
can load images and sounds and has the startUp() method
/* HotSpotListener is required to let HotSpot call hotSpotEvent(HotSpot) when it
has been clicked
//runnable is for looping purpose ....to animate the text or images.
public class LibraryTest extends Applet implements Loadable, HotSpotListener, Runnable
     // RealMedia will load and save images and sounds.
     // It will also give information on the loading process.     
     RealMedia rm;
     // Four buttons that can be clicked on.
     HotSpot hs1,hs2,hs3,hs4;
     // 1 will show image 0 and 1 will show image 1.
     int x =0;
/* new added code */
     Thread scroller;     //for looping purpose
     int loopcounter,count;
     // thread is to allow the program to be called every and then.
     public void init()
          /*new added code */
          loopcounter=0;
          // We'll place the buttons ourselves.
          setLayout(null);
          setBackground(Color.white);
          // create the RealMedia object
          rm = new RealMedia(this);
          //Start adding all image files you will use
          // image0 called pic_black
          rm.add("pic_black.jpg","image0");
          rm.add("EG3165 Tutorial 1.jpg","image0_1");
          rm.add("Question.jpg","image0_2");
          rm.add("Solution.jpg","image0_3");
          rm.add("Exercise.jpg","image0_4");
          //rm.add("cute.gif","image0_5");
          rm.add("mac-win.gif","image0_6");
          rm.add("walking-floppy.gif","image0_7");
          rm.add("eg3165_t001ver03_00.gif","image1");
          rm.add("eg3165_t001ver03_01.gif","image2");
          rm.add("eg3165_t001ver03_02.gif","image3");
          rm.add("eg3165_t001ver03_03.gif","image4");
          rm.add("eg3165_t001ver03_04.gif","image5");
          rm.add("eg3165_t001ver03_05.gif","image6");
          rm.add("eg3165_t001ver03_06.gif","image7");
          rm.add("eg3165_t001ver03_07.gif","image8");
          rm.add("eg3165_t001ver03_08.gif","image9");
          // Start button with 4 images
          // 1 Default state, mouseOver and mouseClick state.
          rm.add("1st.gif");
          rm.add("1st.gif");
          rm.add("1st.gif");
          // 2 Other button
          rm.add("prev.gif");
          rm.add("prev.gif");
          rm.add("prev.gif");
          // 3
          rm.add("next.gif");
          rm.add("next.gif");
          rm.add("next.gif");
          // 4
          rm.add("last.gif");
          rm.add("last.gif");
          rm.add("last.gif");
          // load the images now
          rm.load();
     public void startUp()
          // button 1
          hs1 = new HotSpot(this);
          hs1.setImage(rm.get("1st.gif"),1);
          hs1.setImage(rm.get("1st.gif"),2);
          hs1.setImage(rm.get("1st.gif"),3);
          hs1.setBounds(200,515,40,38);
          // same for button 2
          hs2 = new HotSpot(this);
          hs2.setImage(rm.get("prev.gif"),1);
          hs2.setImage(rm.get("prev.gif"),2);
          hs2.setImage(rm.get("prev.gif"),3);
          hs2.setBounds(250,515,40,38);
          // same for button 3
          hs3 = new HotSpot(this);
          hs3.setImage(rm.get("next.gif"),1);
          hs3.setImage(rm.get("next.gif"),2);
          hs3.setImage(rm.get("next.gif"),3);
          hs3.setBounds(300,515,40,38);
          // same for button 4
          hs4 = new HotSpot(this);
          hs4.setImage(rm.get("last.gif"),1);
          hs4.setImage(rm.get("last.gif"),2);
          hs4.setImage(rm.get("last.gif"),3);
          hs4.setBounds(350,515,40,38);
          // Place them
          add(hs1);
          add(hs2);
          add(hs3);
          add(hs4);
          // Repaint makes sure they are immediately visible.
          hs1.repaint();
          hs2.repaint();
          hs3.repaint();
          hs4.repaint();
     // Here the images are drawn.
     public void paint(Graphics g)
          g.setColor(Color.white);
          // When it is still loading show a loading message.
          if (!rm.isLoaded())
               g.drawString("loading file "+rm.getCurrent(),20,20);
               g.drawString("of "+rm.getTotalFiles(),20,40);
               g.drawString("Percent: "+rm.getPercent(),20,60);
               g.fillRect(20,80,rm.getPercent(),20);
          // Otherwise draw image1 or 2
          else
               if (x == 0)
                    //place images using x-coordinates, y-coordinates.
                    g.drawImage(rm.get("image0"),20,20,this);
                    g.drawImage(rm.get("image0_1"),80+loopcounter,100+loopcounter,this);
                    g.drawImage(rm.get("image0_2"),190+loopcounter,175+loopcounter,this);
                    g.drawImage(rm.get("image0_3"),240+loopcounter,220+loopcounter,this);
                    g.drawImage(rm.get("image0_4"),290+loopcounter,265+loopcounter,this);
                    //g.drawImage(rm.get("image0_5"),150+loopcounter,285+loopcounter,this);
                    g.drawImage(rm.get("image0_6"),400,370,200,100,this);
                    g.drawImage(rm.get("image0_7"),100,300,this);
                    loopcounter+=2;
                    if (loopcounter == 50)
                    loopcounter = 0;
     // if loopcounter+=2, coordinate=x+loopcounter, y+loopcounter.
     /* e.g. round 1, loopcounter=0, coordinate=1,3 */
     /* e.g. round 2, loopcounter=2, coordinate=3,5 */
     /* e.g. round 3, loopcounter=4, coordinate=7,9 */
               else if (x == 1)
                    g.drawImage(rm.get("image1"),20,20,this);
               else if (x == 2)
                    g.drawImage(rm.get("image2"),20,20,this);
               else if (x == 3)
                    g.drawImage(rm.get("image3"),20,20,this);
               else if (x == 4)
                    g.drawImage(rm.get("image4"),20,20,this);
               else if (x == 5)
                    g.drawImage(rm.get("image5"),20,20,this);
               else if (x == 6)
                    g.drawImage(rm.get("image6"),20,20,this);
               else if (x == 7)
                    g.drawImage(rm.get("image7"),20,20,this);
               else if (x == 8)
                    g.drawImage(rm.get("image8"),20,20,this);
               else if (x == 9)
                    g.drawImage(rm.get("image9"),20,20,this);
     // This method is called when a button has been clicked.
     public void hotSpotEvent(HotSpot hs)
          // if it was button 1 show image1.
          if (hs == hs1)
               x = 1;
          // else show image2
          else if (hs == hs2)
               {x = x - 1;
               if ( x <= 1 ) x = 1;
          else if (hs == hs3)
               {x = x + 1;
               if ( x >= 9 ) x = 9;
          else
               x = 9;
          // and repaint to show them.
          repaint();
     // Necessary for RealMedia to load your images
     public Image loadImage(String file)
          return getImage(getCodeBase(),file);
     // Also required but not used this time.
     public AudioClip loadAudio(String file)
          return getAudioClip(getDocumentBase(),file);
/*new added code*/
     public void start() {
            if (scroller == null) {
            scroller = new Thread(this);
            scroller.start();
    public void stop() {
        if (scroller != null) {
            scroller.stop();
            scroller = null;
    public void run() {
          try {Thread.currentThread().sleep(100);}
            catch (InterruptedException e){}
        for (count=0; count <= 400; ) {
          try {Thread.currentThread().sleep(20);}
            catch (InterruptedException e){}
          rm.load();
    public void destroy(){;}
    public void update(Graphics g){paint(g);}
}

Thread scroller;//for looping purpose
**like whats does "thread scroller" means? Looping purpose? what's looping then?So, you don't know what a variable declaration is, and you don't know what looping is, and you're unable to find out other than by having somebody here tell you (your school has no library, no bookstore, and no access to google--only to the Java forums).
Either your school is absolutely backwards and useless, or you're a stupid lazy git who deserves to fail the course. Either way, somebody here posting an answer for you is not going to help you.
The following might.
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. This one has been getting a lot of very positive comments lately.

Similar Messages

  • Need help with a activation code for Adobe Acrobat X Standard for my PC,, Don't have older version serial numbers,  threw programs away,  only have Adobe Acrobat X Standard,  need a code to unlock program?

    Need help with a activation code for Adobe Acrobat X Standard for my PC, Don't have older Version of Adobe Acrobat 9, 8 or 7. 

    You don't need to install the older version, you only need the serial number from your original purchase. If you don't have them to hand, did you register? If so, they should be in your Adobe account. If not you really need to contact Adobe, though it isn't clear they will be able to do anything without some proof of purchase etc.

  • I need help getting new authorization codes for digital copies

    I need help getting new authorization codes for digital copies of movies. Can someone help me out?

    There's a lot of results in Google when you search for this but unfortunately refreshing the page doesn't seem to generate a different code anymore. Mine also says already redeemed

  • Looking help for developing labview code [Urgent]

    Hi,
    I need help in developing labview code. I am new to labview and will appreciate if someone can help me in this matter. I need to control the intensity of AC load (halogen lamp with 2kW,230V,50Hz) using Labview and Arduino. But my project using interrupt in Arduino, so it is not possible to use Labview Interface For Arduino(LIFA).  I searched and it might be possible to use VISA serial in this matter. Attached is the circuit and the code of Arduino. Someone who is expert in this matter can help me?
    The concept of my project is almost same with https://www.youtube.com/watch?v=oeVJ5bs6E8M&feature=youtu.be
    Solved!
    Go to Solution.
    Attachments:
    Zero Cross Circuit.docx ‏203 KB
    Triggering Circuit.docx ‏48 KB
    Coding for Arduino.txt ‏7 KB

    Hi,
    You will find all information you need and LabVIEW VI examples on the LabVIEW Interface for Arduino
    LabVIEW Interface for Arduino
    Regards,
    Valentin
    Certified TestStand Architect
    Certified LabVIEW Developer
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    Travaux Pratiques d'initiation à LabVIEW et à la mesure
    Du 2 au 23 octobre, partout en France

  • Need help to redeem contact code for OS X 7

    Need help to redeem contact code for OS X 7

    Hello NOREDEEM,
    Thanks for using Apple Support Communities.
    If you have the purchase code for OS X 10.7 Lion, then you can follow the directions below to redeem it on your Mac.
    Mac App Store: Redeem gift cards and download codes
    Take care,
    Alex H.

  • I just deleted photos from my iPad. I need help on recover these photos

    I accidentally deleted photos in my iPad. I need help to recover these photos. Thanks

    Restore from your Backup or Re-Sync them from your computer where you have been regularily Transferring them to.

  • I need help I scratched the code off my itunes card

    I need help I scratched the code off my itunes card

    Click here and ask the iTunes Store staff for assistance. Supply them with as much of the code as you can.
    (102006)

  • Pulling the condition records - help in the ABAP code -urgent!!!!!

    hi folks,
    I need some urgent help here..
    I have discussed this portion before in the forum  but there are some changes and I need some help here.
    The code goes like this....
    select knumv kschl kbetr kwert
      from konv into table cdata
         for all entries in bodyitab21
        where konv~knumv = bodyitab21-knumv
                     and konv~kwert > 0.
    I am successfully pulling the data into cdata here..
    I need to check for various condition types that are around 100. I need to split them into two types because some condition types containe just pricing values while some others have values in % (but the value not stored in that format) To do the extra coding I have use two differetn case statements and that's what i have done here.
    <b>My probelm is I will have to check for each condition type, if the 'kwert' field has some value in it pull the data  and there is a condition text associcated to it in the table 'T685T' that needs to be pulled into the itab.
    This process has to be done for every condition type.</b>Given this scenario how can i do it?
        loop at cdata  into wac.
        case wac-kschl.
             when 'ZRAT' OR 'ZAGR'  OR 'ZRCR' OR 'Y098' OR 'Y007' OR 'ZREW' OR 'Y106' OR 'ZTSR' OR 'Y127' OR 'Y125' OR 'Y126' OR 'Y124' OR 'Y157' OR 'Y092' OR 'Y085' OR 'Y090' OR 'ZMZD' OR 'Y215' OR 'Y214' OR 'Y111' OR 'ZC$D' OR 'ZAUD' OR 'ZTHX' OR 'ZCOL'
    OR 'ZCFE' OR ZSPA' OR 'ZBOX' OR 'ZCOR' OR 'Y130' OR 'ZBOR'
    OR 'Y108' OR 'ZFPP' OR 'Y204' OR 'Y200' OR 'Y202' OR 'Y201' OR 'Y203' OR 'Y002' OR 'ZSCR' OR 'Y128' OR 'Y100' OR 'ZABS' OR 'ZSMG' OR 'ZFRE' OR 'ZREC' OR 'ZCOM' OR 'ZPMG' OR 'BEMG' OR 'ZDTI' OR'ZBET'.
    <b>***** the first set of these condition types have just values</b>     if wac-kbetr = ' ' AND wac-kwert = ' '.
                   continue.
                 else.
                  p = wac-kbetr.
                  i = p.
                  c = i.
                  MOVE c to w_accitab-zrate.
                     MOVE wac-kbetr to w_accitab-zrate.
                  MOVE wac-kwert to w_accitab-zsubtotal.
                endif.
        when 'ZSED' OR 'ZRFQ' OR 'ZIMP' OR 'ZERR'
         OR 'ZECD' 'ZAC1' OR 'ZAC%' OR 'ZAC2' OR 'ZSED' OR 'ZRFQ' OR 'ZIMP' OR 'ZERR' OR 'ZECD' 'ZQUD' OR 'ZEMP' OR 'Y101' OR 'Y012' OR 'ZCHU' OR 'Y054' OR 'Y065' OR 'Y066' OR 'Y067' OR 'Y068' OR 'Y069' OR 'Y096'
    OR 'Y103' OR 'Y010' OR 'Y070' OR 'Y071' OR
    'Y072' OR 'Y073' OR 'Y074' OR 'Y075' OR 'Y076'
    OR 'Y077' OR 'Y078' OR 'Y079' OR 'Y156' OR OR 'Y148'
    OR 'Y102' OR 'Y205' OR 'Y206' OR 'Y207' OR 'Y208' OR
    'Y209' OR 'Y213' OR 'Y210' OR 'Y211' OR 'Y212' OR 'Z%DS'
    OR 'Z%DO' OR 'Y113' OR 'Y151' OR 'Y152' OR 'Y153' OR
    'Y154' OR 'Y155' OR 'Y147' OR'Z%PB' OR 'Y142' OR 'Y131'
    OR 'Y141' OR 'Y149' OR 'ZDEO' OR 'Z%DR' OR 'Y115' OR
    'Y116' OR 'Y095' OR 'Y084' OR 'ZSA$' OR 'ZSA%' OR
    'ZPA$' OR 'ZPA%'.
    the second set of these condition types have just values that has to be converted into %.
               if wac-kbetr = ' ' AND wac-kwert = ' '.
                clear w_accitab-zrate.
                continue.
              else.
                p = wac-kbetr.
                p = p / 10.
                if p < 1.
                  rate+0(1) = '-'.
                endif.
                if i = 0.
                  clear w_accitab-zrate.
                 else.
                i = p.
                c = i.
                shift c right deleting trailing '-'.
                concatenate rate c '%' into rate.
                condense rate no-gaps.
                     MOVE wac-kbetr to w_accitab-zrate.
                MOVE rate to w_accitab-zrate.
                clear rate.
                MOVE wac-kwert to w_accitab-zsubtotal.
              endif.
            endif.
    Thanks alot in advance.
    Santhosh

    Maybe this will help you,  otherwise I'm missing something.
    [code]
    data: begin of wac,
          kschl type t685t-kschl,
          vtext type t685t-vtext,
          end of wac.
    case wac-kschl.
    when 'ZRAT' or 'ZAGR' or 'ZRCR' or 'Y098' or 'Y007' or 'ZREW' or 'Y106'
    or 'ZTSR' or 'Y127' or 'Y125' or 'Y126' or 'Y124' or 'Y157' or 'Y092' or
      'Y085' or 'Y090' or 'ZMZD' or 'Y215' or 'Y214' or 'Y111' or 'ZC$D' or
         'ZAUD' or 'ZTHX' or 'ZCOL' or 'ZCFE' or 'ZSPA' or 'ZBOX' or 'ZCOR'
    or 'Y130' or 'ZBOR' or 'Y108' or 'ZFPP' or 'Y204' or 'Y200' or 'Y202' or
      'Y201' or 'Y203' or 'Y002' or 'ZSCR' or 'Y128' or 'Y100' or 'ZABS' or
         'ZSMG' or 'ZFRE' or 'ZREC' or 'ZCOM' or 'ZPMG' or 'BEMG' or 'ZDTI'
            or'ZBET'.
    Some code
      when 'ZSED' or 'ZRFQ' or 'ZIMP' or 'ZERR'
    or 'ZECD' or 'ZAC1' or 'ZAC%' or 'ZAC2' or 'ZSED' or 'ZRFQ' or 'ZIMP' or
      'ZERR' or 'ZECD' or 'ZQUD' or 'ZEMP' or 'Y101' or 'Y012' or 'ZCHU' or
      'Y054' or 'Y065' or 'Y066' or 'Y067' or 'Y068' or 'Y069' or 'Y096'
      or 'Y103' or 'Y010' or 'Y070' or 'Y071' or
      'Y072' or 'Y073' or 'Y074' or 'Y075' or 'Y076'
      or 'Y077' or 'Y078' or 'Y079' or 'Y156' or 'Y148'
      or 'Y102' or 'Y205' or 'Y206' or 'Y207' or 'Y208' or
      'Y209' or 'Y213' or 'Y210' or 'Y211' or 'Y212' or 'Z%DS'
      or 'Z%DO' or 'Y113' or 'Y151' or 'Y152' or 'Y153' or
      'Y154' or 'Y155' or 'Y147' or'Z%PB' or 'Y142' or 'Y131'
      or 'Y141' or 'Y149' or 'ZDEO' or 'Z%DR' or 'Y115' or
      'Y116' or 'Y095' or 'Y084' or 'ZSA$' or 'ZSA%' or
      'ZPA$' or 'ZPA%'.
    Some code
    endcase.
    select single vtext into wac-vtext from t685t
                  where spras = sy-langu
                    and kschl = wac-kschl.
    write:/ wac-kschl, wac-vtext.
    [/code]
    Regards,
    Rich Heilman

  • Need help fine tuning my code

    This program im making is eventualy going to end up as an attack calculator; the thing is i need help finetuning my program so that a) when it is run it will start at the very top of the window ancestory. b) the 2 windows are locked onto the same ancestory (ancestory is the position of the window relitive to the others: ie the window that is on top of another is higher on the ancestory). this code runs and should easily cut and paste.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class AttackCalculator implements ActionListener{
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event-dispatching thread.
         "Use the legend below for the correct government number. ",
          "Legend: Democracy = 1, Communism = 2, Autocracy = 3, Fascism = 4, ",
          "Monarchy = 5, Pacifism = 6, Technocracy = 7, Theocracy = 8, ",
          "Anarchy = 9, Corpocracy = 10, Ochlocracy = 11, Physiocracy = 12 ",
           public static void createAndShowGUI(){
           String[] labels = {
          "Enter how many troops you have: ", "Enter how many tanks you have: ",
          "Enter how many jets you have: ", "Enter how many ships you have: ",
          "Enter your government type (1-12 refer above): ","Enter your health(%)",
          "Enter your stage number (1-4): ", "Enter how many troops your enemy has: ",
          "Enter how many tanks your enemy has: ", "Enter how many jets your enemy has: ",
          "Enter how many ships your enemy has: ", "Enter your enemy's government type (1-12 refer above): ",
          "Enter your enemy's stage number (1-4): ", "Enter your enemy health: "};
            int numPairs = labels.length;
           JTextField[] textField = {
           new JTextField( 10 ), new JTextField( 1 ), new JTextField( 1 ), new JTextField( 1 ), new JTextField( 1 ),
           new JTextField( 1 ), new JTextField( 10 ), new JTextField( 1 ), new JTextField( 1 ), new JTextField( 1 ),
           new JTextField( 1 ), new JTextField( 1 ), new JTextField( 1 ), new JTextField( 1 )};
            //Create and populate the panel.
            JPanel p = new JPanel(new SpringLayout());
            for (int i = 0; i < numPairs; i++) {
                JLabel l = new JLabel(labels, JLabel.TRAILING);
    p.add(l);
    l.setLabelFor(textField[i]);
    p.add(textField[i]);
    JLabel l = new JLabel("Your union has 2+ members", JLabel.TRAILING);
    p.add(l);
    JCheckBox checkBox = new JCheckBox("", false);
    l.setLabelFor( checkBox );
    p.add(checkBox );
    JLabel la = new JLabel("Enemy's union 2+ members", JLabel.TRAILING);
    p.add(la);
    JCheckBox jcheckBox = new JCheckBox("", false);
    la.setLabelFor( jcheckBox );
    p.add(jcheckBox);
    JButton calculate = new JButton("Calculate");
    p.add(calculate);
    //Lay out the panel.
    SpringUtilities.makeCompactGrid(p,
    16, 2, //rows, cols
    6, 6, //initX, initY
    6, 6); //xPad, yPad
    JFrame contentPane = new JFrame();
    contentPane.setSize(420, 105);
    JLabel title1 = new JLabel("Use the legend below for the correct government number. \n");
    JLabel title2 = new JLabel("Legend: Democracy = 1, Communism = 2, Autocracy = 3, Fascism = 4, \n");
    JLabel title3 = new JLabel("Monarchy = 5, Pacifism = 6, Technocracy = 7, Theocracy = 8, \n");
    JLabel title4 = new JLabel("Anarchy = 9, Corpocracy = 10, Ochlocracy = 11, Physiocracy = 12 " );
    contentPane.add( title1 );
    contentPane.add( title2 );
    contentPane.add( title3 );
    contentPane.add( title4 );
    SpringLayout layout = new SpringLayout();
    contentPane.setLayout(layout);
    //Adjust constraints for the label so it's at (5,5).
    layout.putConstraint(SpringLayout.WEST, title1,
    5,
    SpringLayout.WEST, contentPane);
    layout.putConstraint(SpringLayout.NORTH, title1,
    5,
    SpringLayout.NORTH, contentPane);
    //Adjust constraints for the label so it's at (5,5).
    layout.putConstraint(SpringLayout.WEST, title2,
    5,
    SpringLayout.WEST, contentPane);
    layout.putConstraint(SpringLayout.NORTH, title2,
    20,
    SpringLayout.NORTH, contentPane);
    //Adjust constraints for the label so it's at (5,5).
    layout.putConstraint(SpringLayout.WEST, title3,
    5,
    SpringLayout.WEST, contentPane);
    layout.putConstraint(SpringLayout.NORTH, title3,
    35,
    SpringLayout.NORTH, contentPane);
    //Adjust constraints for the label so it's at (5,5).
    layout.putConstraint(SpringLayout.WEST, title4,
    5,
    SpringLayout.WEST, contentPane);
    layout.putConstraint(SpringLayout.NORTH, title4,
    50,
    SpringLayout.NORTH, contentPane);
    //Create and set up the window.
    JFrame frame1 = new JFrame("Endless Revolution Attack Calculator");
    frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);
    //Set up the content pane.
    p.setOpaque(true); //content panes must be opaque
    frame1.setContentPane(p);
    //Display the window.
    frame1.pack();
    frame1.setLocationRelativeTo( null );
    frame1.setVisible(true);
    contentPane.setLocationRelativeTo( null );
    contentPane.setVisible(true);
    public void actionPerformed( ActionEvent evt){
    public static void main(String[] args) {
    //Schedule a job for the event-dispatching thread:
    //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();
    here is the second class needed to run
    import javax.swing.*;
    import javax.swing.SpringLayout;
    import java.awt.*;
    * A 1.4 file that provides utility methods for
    * creating form- or grid-style layouts with SpringLayout.
    * These utilities are used by several programs, such as
    * SpringBox and SpringCompactGrid.
    public class SpringUtilities {
         * A debugging utility that prints to stdout the component's
         * minimum, preferred, and maximum sizes.
        public static void printSizes(Component c) {
            System.out.println("minimumSize = " + c.getMinimumSize());
            System.out.println("preferredSize = " + c.getPreferredSize());
            System.out.println("maximumSize = " + c.getMaximumSize());
         * Aligns the first <code>rows</code> * <code>cols</code>
         * components of <code>parent</code> in
         * a grid. Each component is as big as the maximum
         * preferred width and height of the components.
         * The parent is made just big enough to fit them all.
         * @param rows number of rows
         * @param cols number of columns
         * @param initialX x location to start the grid at
         * @param initialY y location to start the grid at
         * @param xPad x padding between cells
         * @param yPad y padding between cells
        public static void makeGrid(Container parent,
                                    int rows, int cols,
                                    int initialX, int initialY,
                                    int xPad, int yPad) {
            SpringLayout layout;
            try {
                layout = (SpringLayout)parent.getLayout();
            } catch (ClassCastException exc) {
                System.err.println("The first argument to makeGrid must use SpringLayout.");
                return;
            Spring xPadSpring = Spring.constant(xPad);
            Spring yPadSpring = Spring.constant(yPad);
            Spring initialXSpring = Spring.constant(initialX);
            Spring initialYSpring = Spring.constant(initialY);
            int max = rows * cols;
            //Calculate Springs that are the max of the width/height so that all
            //cells have the same size.
            Spring maxWidthSpring = layout.getConstraints(parent.getComponent(0)).
                                        getWidth();
            Spring maxHeightSpring = layout.getConstraints(parent.getComponent(0)).
                                        getWidth();
            for (int i = 1; i < max; i++) {
                SpringLayout.Constraints cons = layout.getConstraints(
                                                parent.getComponent(i));
                maxWidthSpring = Spring.max(maxWidthSpring, cons.getWidth());
                maxHeightSpring = Spring.max(maxHeightSpring, cons.getHeight());
            //Apply the new width/height Spring. This forces all the
            //components to have the same size.
            for (int i = 0; i < max; i++) {
                SpringLayout.Constraints cons = layout.getConstraints(
                                                parent.getComponent(i));
                cons.setWidth(maxWidthSpring);
                cons.setHeight(maxHeightSpring);
            //Then adjust the x/y constraints of all the cells so that they
            //are aligned in a grid.
            SpringLayout.Constraints lastCons = null;
            SpringLayout.Constraints lastRowCons = null;
            for (int i = 0; i < max; i++) {
                SpringLayout.Constraints cons = layout.getConstraints(
                                                     parent.getComponent(i));
                if (i % cols == 0) { //start of new row
                    lastRowCons = lastCons;
                    cons.setX(initialXSpring);
                } else { //x position depends on previous component
                    cons.setX(Spring.sum(lastCons.getConstraint(SpringLayout.EAST),
                                         xPadSpring));
                if (i / cols == 0) { //first row
                    cons.setY(initialYSpring);
                } else { //y position depends on previous row
                    cons.setY(Spring.sum(lastRowCons.getConstraint(SpringLayout.SOUTH),
                                         yPadSpring));
                lastCons = cons;
            //Set the parent's size.
            SpringLayout.Constraints pCons = layout.getConstraints(parent);
            pCons.setConstraint(SpringLayout.SOUTH,
                                Spring.sum(
                                    Spring.constant(yPad),
                                    lastCons.getConstraint(SpringLayout.SOUTH)));
            pCons.setConstraint(SpringLayout.EAST,
                                Spring.sum(
                                    Spring.constant(xPad),
                                    lastCons.getConstraint(SpringLayout.EAST)));
        /* Used by makeCompactGrid. */
        private static SpringLayout.Constraints getConstraintsForCell(
                                                    int row, int col,
                                                    Container parent,
                                                    int cols) {
            SpringLayout layout = (SpringLayout) parent.getLayout();
            Component c = parent.getComponent(row * cols + col);
            return layout.getConstraints(c);
         * Aligns the first <code>rows</code> * <code>cols</code>
         * components of <code>parent</code> in
         * a grid. Each component in a column is as wide as the maximum
         * preferred width of the components in that column;
         * height is similarly determined for each row.
         * The parent is made just big enough to fit them all.
         * @param rows number of rows
         * @param cols number of columns
         * @param initialX x location to start the grid at
         * @param initialY y location to start the grid at
         * @param xPad x padding between cells
         * @param yPad y padding between cells
        public static void makeCompactGrid(Container parent,
                                           int rows, int cols,
                                           int initialX, int initialY,
                                           int xPad, int yPad) {
            SpringLayout layout;
            try {
                layout = (SpringLayout)parent.getLayout();
            } catch (ClassCastException exc) {
                System.err.println("The first argument to makeCompactGrid must use SpringLayout.");
                return;
            //Align all cells in each column and make them the same width.
            Spring x = Spring.constant(initialX);
            for (int c = 0; c < cols; c++) {
                Spring width = Spring.constant(0);
                for (int r = 0; r < rows; r++) {
                    width = Spring.max(width,
                                       getConstraintsForCell(r, c, parent, cols).
                                           getWidth());
                for (int r = 0; r < rows; r++) {
                    SpringLayout.Constraints constraints =
                            getConstraintsForCell(r, c, parent, cols);
                    constraints.setX(x);
                    constraints.setWidth(width);
                x = Spring.sum(x, Spring.sum(width, Spring.constant(xPad)));
            //Align all cells in each row and make them the same height.
            Spring y = Spring.constant(initialY);
            for (int r = 0; r < rows; r++) {
                Spring height = Spring.constant(0);
                for (int c = 0; c < cols; c++) {
                    height = Spring.max(height,
                                        getConstraintsForCell(r, c, parent, cols).
                                            getHeight());
                for (int c = 0; c < cols; c++) {
                    SpringLayout.Constraints constraints =
                            getConstraintsForCell(r, c, parent, cols);
                    constraints.setY(y);
                    constraints.setHeight(height);
                y = Spring.sum(y, Spring.sum(height, Spring.constant(yPad)));
            //Set the parent's size.
            SpringLayout.Constraints pCons = layout.getConstraints(parent);
            pCons.setConstraint(SpringLayout.SOUTH, y);
            pCons.setConstraint(SpringLayout.EAST, x);
    }I know this is a lot but when I have tried to put out the portion where I belived the problem to be, didnt work, people couldent help, so here it is all of it.

    it wouldn't run for me, until I changed these lines
    contentPane.add( title1 );
    contentPane.add( title2 );
    contentPane.add( title3 );
    contentPane.add( title4 );
    SpringLayout layout = new SpringLayout();
    contentPane.setLayout(layout);
    to these
    contentPane.getContentPane().add( title1 );
    contentPane.getContentPane().add( title2 );
    contentPane.getContentPane().add( title3 );
    contentPane.getContentPane().add( title4 );
    SpringLayout layout = new SpringLayout();
    contentPane.getContentPane().setLayout(layout);
    then it worked OK, smaller frame on top (the one with the info), larger frame behind.
    both above all other windows
    made it into a .jar file (in case IDE influenced above) and ran the same way

  • Need help on combining these two program

    Hi all,
     I needed some help on combining these two program. But i not very sure how to do it.
    My program in working with TimeIn/TimeOut attendance taking. The snippet vi "insert data" is the where i start to TimeIn and insert into the microsoft access. And i wanted to insert it together with a camera catching the user's face. But i have no clues on how to combine them.
     Can u guys give me some ideas to help me ?
    Thanks in advance.
    Attachments:
    IMAQdx.png ‏55 KB
    insert data.png ‏68 KB

    Hi Himanshu,
    But if i put everything inside the IMAQdx loop ,it make my whole program more complicated. 
    This is how my program looks like below.
    I only want to display the image only when i "insert" all data into the database ( which i given at the perivous post).
    Is there other way?? And how do u make the IMAQdx loop stop without putting a stop button?? Because everytime i run the program,it will run continuously at the IMAQdx loop..
    Thank in Advance.
    Attachments:
    FYP.png ‏205 KB

  • Need Help With Simple ABAP Code

    Hello,
    I'm loading data from a DSO (ZDTBMAJ) to an Infocube (ZCBRAD06). I need help with ABAP code to some of the logic in Start Routine. DSO has 2 fields: ZOCTDLINX & ZOCBRDMAJ.
    1. Need to populate ZOCPRODCD & ZOCREFNUM fields in Infocube:
        Logic:-
        Lookup /BI0/PMATERIAL, if /BIC/ZOCBRDMAJ = /BIC/OIZOCBRDMAJ
        then /BIC/ZOCPRODCD = ZOCPRODCD in Infocube
               /BIC/ZOCREFNUM = ZOCREFNUM in Infocube         
    2. Need to populate 0G_CWWTER field in Infocube:
        Logic:
        Lookup /BIC/PZOCTDLINX, if /BIC/ZOCTDLINX = BIC/OIZOCTDLINX
        then G_CWWTER = 0G_CWWTER in Infocube.
    I would need to read single row at a time.
    Thanks!

    I resolved it.

  • Need help with pie chart code

    I am new to Java and am having problems and I am in need of some help. I have written the code for my Mortgage Calculator but do not know how to get my chart to work. I found an example of the chart code in my text book but I am not sure if I wrote it wrong. When I run the MortCalc code it compiles but the Pie Chart code won't. I tried to run the chart code by itself but it prints out another calculator. My question is 1.) Is my chart code written wrong? and 2.) How do i enter it into my MortCalc code so that I get my chart?
    **Below I have included the assignment(so you know what I am doing exactly) and below that the pie chart code just in case you have questions. Thanks for any advice you can give.
    **If you need the rest of the code I can post it too. It was too long to post with the pie chart code.
    Assignment:
    Write the program in Java(w/ a GUI) and have it calculate and display the mortgage payment amount from user input of the amount of the mortgage adn the user's selection from a menu of availible mortgage loans:
    --7 yrs @ 5.35%
    --15 yrs @ 5.5%
    --30 yrs @ 5.75%
    Use an array for the mortgage data for the different loans. Read the interst rates to fill the array from a sequential file. Display the mortgage payment amount followed by the loan balance and interest paid for each payment over the term of the loan. Add graphics in the form of a chart.Allow the user to loop back and enter a new amount and make a new selection of quit. Please insert comments in the program to document the program.
    CODE:
    import java.awt.Color;
    import java.awt.Graphics2D;
    import java.awt.Rectangle;
    //Class to hold a value for a slice
    public class PieValue {
    double value;
    Color color;
    public PieValue(double value, Color color) {
    this.value = value;
    this.color = color;
    // slices is an array of values that represent the size of each slice.
    public void drawPie(Graphics2D g, Rectangle area, PieValue[] slices) {
    // Get total value of all slices
    double total = 0.0D;
    for (int i=0; i<slices.length; i++) {
    total += slices.value;
    // Draw each pie slice
    double curValue = 0.0D;
    int startAngle = 0;
    for (int i=0; i<slices.length; i++) {
    // Compute the start and stop angles
    startAngle = (int)(curValue * 360 / total);
    int arcAngle = (int)(slices[i].value * 360 / total);
    // Ensure that rounding errors do not leave a gap between the first and last slice
    if (i == slices.length-1) {
    arcAngle = 360 - startAngle;
    // Set the color and draw a filled arc
    g.setColor(slices[i].color);
    g.fillArc(area.x, area.y, area.width, area.height, startAngle, arcAngle);
    curValue += slices[i].value;

    // Draw each pie slice
    double curValue = 0.0D;
    int startAngle = 0;
    for (int i=0; i<slices.length; i+) {
    // Compute the start and stop angles
    startAngle = (int)(curValue 360 / total);
    int arcAngle = (int)(slices.value * 360 / total);Look here and i think you will find some syntax errors.
    Count the brackets.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • I need help activating my redemption code.

    I need help activating my redemption code

    Hello Joe,
    as an addition: please have a look there Redemption Code Help and if necessary and for further questions click through (Still need help? Contact us.) >>>
    http://helpx.adobe.com/contact.html and if "open" please use chat, I had the best experiences. I quote from Adobe's employee Preran: The chat button is activated as soon as there is an agent available to help.
    Good luck!
    Hans-Günter

  • Need help embedding mailchimp subscription code into dreamweaver.

    so I created my page in edge animate, and then I brought it over to adobe dreamweaver, and I dont know where or how to place my embeded mailchimp code? 
    <!-- Begin MailChimp Signup Form -->
    <link href="//cdn-images.mailchimp.com/embedcode/slim-081711.css" rel="stylesheet" type="text/css">
    <style type="text/css">
              #mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif;  width:360px;}
              /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
                 We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
    </style>
    <div id="mc_embed_signup">
    <form action="http://kandied.us3.list-manage.com/subscribe/post?u=4525b320bd81872705a48ea05&id=4743a970b 1" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
              <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
        <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
        <div style="position: absolute; left: -5000px;"><input type="text" name="b_4525b320bd81872705a48ea05_4743a970b1" value=""></div>
              <div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
    </form>
    </div>
    <!--End mc_embed_signup-->
    I keep trying to add it to it, but I either get noting or just the subscription box. does this happen due to my edge animate project?

    Ben Thank you so much for your reply! It helped me read the code and made me understand it better. I decided to make my own subscription box by making a symbol "Subscription" and inside this i created two more symbols called "Textbox" and "Submittbutton". I tried putting in part of the code from above under the div id, but it kept creating the whole text box behind the symbols in dreamweaver. How would you suggest I embed the code from above into my created submission box below?
             <div id="Stage_Center2_Subscription">
                    <div id="Stage_Center2_Subscription_subscribe"></div>
                    <div id="Stage_Center2_Subscription_Submittbutton">
                        <div id="Stage_Center2_Subscription_Submittbutton_Submitbutton">
                            <div id="Stage_Center2_Subscription_Submittbutton_Submitbutton_RoundRect2"></div>
                        </div>
                        <div id="Stage_Center2_Subscription_Submittbutton_text">
                            <div id="Stage_Center2_Subscription_Submittbutton_text_Text">Join</div>
                        </div>
                    </div>
                    <div id="Stage_Center2_Subscription_Textbox">
                        <div id="Stage_Center2_Subscription_Textbox_textbox">
                            <div id="Stage_Center2_Subscription_Textbox_textbox_RoundRect"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>
    </html>
    Thank you for taking the time to look at my question! I really appreciate it!
    Kyle

  • Need help with adjusting Javascript code to work in Adobe Edge (Countdown)

    Hello
    Im a newbie when it comes to working with Javascript and Adobe Edge and need a bit of help with adjusting some javascript code to work with Adobe Edge. A friend of mine helped me with making this javascript code: Edit fiddle - JSFiddle
    Its a simple countdown which counts down to a certain time at a certain date. What I aim to do is to add this code as a trigger on a text-element called "countdown" (within a symbol called "count").
    I have tried to do this as the code is, but it does not work. Anyone have any suggestions?
    Thanks!
    Mvh,
    Øyvind Hermans

    Hello again
    I have stumbled upon a problem with these animations; They crash the browser after viewing them a little while, usually less than 30 seconds in.
    Is this problem also occuring when you watch the animations?
    Is the countdown-code to much for the browsers to handle?
    Thanks in advance for your answers.
    Sincerely,
    Øyvind Hermans

Maybe you are looking for