Help with heapsort.  Pretty new to java

Hello,
I am following a tutorial on heapsort for my java class. I implemented it but the problem is this. The first element in the array i pass in is never changed. Here is the code. What am i doing wrong from this tutorial. What should i do?
public static <T extends Comparable<T>> void heapSort(T[] array)
        heapit(array.length - 1,array);
  public static<T extends Comparable<T>>void swap(int i, int j,T[] array)
      T temp = array[j];
       array[j] = array;
array[i] = temp;
public static <T extends Comparable<T>>void heapit( int end,T[] array )
for ( int i = end / 2; i >= 1; i-- )
fixheap( i, end, array[i],array );
for ( int i = end; i > 1; i-- )
swap( 1, i,array );
fixheap( 1,i - 1 , array[1],array );
public static <T extends Comparable<T>>void fixheap( int root, int end,
T key,T[] array )
int child = 2 * root;
if ( child < end && array[child].compareTo(array[child + 1]) < 0 )
child++;
if ( child <= end && key.compareTo(array[child])< 0 )
array[root] = array[child];
fixheap( child, end, key,array );
else
array[root] = key;

ejp wrote:
It's usual to use 1-based indexing in heapsort algorithms.
So maybe the problem is that you are expecting element[0] to be sorted and it isn't? which it won't be, because of the 1-basing.{noformat}
There's nothing a little math can't cure: for a 1 based algorithm a node at position i has its children at position 2*i and 2*i+1 so for a 0 based indexin scheme the node is at position j+1 and its children are at position 2*(j+1) and 2*(j+1)+1. Because the nodes are stored one position to the left the children of node j are 2*(j+1)-1 and 2*(j+1)+1-1.{noformat}
kind regards,
Jos

Similar Messages

  • Can anyone help with associate my new iPhone with iTunes? My other old devices are there, but I see only how to delete one, not how to add one.  Thank you.

    Can anyone help with associate my new iPhone with iTunes? My other old devices are there, but I see only how to delete one, not how to add one.  Thank you.

    iTunes Match is a subscription system that allows you to upload your own music (e.g. coped from CDs) to the cloud so that it shows (in the cloud) on your devices and computers without having to sync/copy it.
    Automatic downloads allows to, for example, buy an app on your computer's iTunes and have it automatically download on your phone without having to connect and sync it or go to the Purchased tab in the App Store app on your download and download it yourself - but doing that, going to the Purchased tab and redownloading an app, should get it associated.
    But no, I'm not aware of any problems that not having it associated causes.

  • Pretty new to Java can someone please help with an addObject() problem?

    Hi I'm pretty knew to programming and I have an assignment which I've been working on but I am stuck
    I have to create a 'space invaders' style game, and I've got some basics working. I wanted to add a boss enemy, which appears when all other enemies have been destroyed. It kind of works, only the program spawns a seemingly infinite amount of the boss which then creates a 'wipe' effect across the top of the screen.
    Here is my code:
    import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
    import java.util.List;
    public class Space extends World
    * Constructor for objects of class Space.
    public Space()
    // Create a new world with 200x250 cells with a cell size of 3x3 pixels.
    super(200, 250, 3);
    //add class with starstreaks
    addObject(new EmptyBox(),1,1);
    //add player character
    addObject(new Player(), 100, 228);
    //add 4 romulan enemies row 1
    for(int i=0; i<4; i++){
    addObject(new Romulan(), (25 + 50 * i), 15);
    //add 3 klingon enemies row 2
    for(int i=0; i<3; i++){
    addObject(new Klingon(), (50 + 50 * i), 40);
    //add 4 romulan enemies row 3
    for(int i=0; i<4; i++){
    addObject(new Romulan(), (25 + 50 * i), 65);
    //add 3 klingon enemies row 4
    for(int i=0; i<3; i++){
    addObject(new Klingon(), (50 + 50 * i), 90);
    //add 3 shields
    for(int i=0; i<3; i++){
    addObject(new Shield(), (30 + 70 * i), 180);
    *public void act(){*
    List<Enemy> enemies = getObjects(Enemy.class);
    *if(enemies.size()==0 ){*
    addObject(new Borg(), 100, 30 );
    I believe the part in bold is the problem, but I dont know why. Klingon and Romulan are subclasses of the Enemy class. The Borg class is it's own seperate class, but with the exact same functions as Enemy. I made it seperate as I figured it would keep respawning if it was a subclass of Enemy.
    Any ideas?

    Its ok, after more than an hour I've got it.
    I simply added private int bossValue = 0; at the beginning and then changed act to this:
    public void act(){
    List<Enemy> enemies = getObjects(Enemy.class);
    if(enemies.size()==0 && bossValue==0 ){
    //for(int i=0; i<1; i++){
    addObject(new Borg(), 100, 30 );
    bossValue =1;
    }

  • Please Help with range of uncertainty in java program

    I really need help with this, I've been searching for an answer all day and have found nothing.
    This is the original program and I'm trying to make it so instead of stoppingDistance having to be equal to tailgateDistance for it to print minor wreck, it will allow a range of 40 feet. Like a range of uncertainty of plus or minus 20 feet, and I need to use a named constant that is: RANGE = 40.0
    import java.util.Scanner;
    public class StoppingA
    public static void main(String[] args)
    Scanner stdIn = new Scanner(System.in);
    double speed; // speed car is traveling;
    double tailgateDistance; // distance from other car;
    double stoppingDistance; // calculated distance
    System.out.print ("Enter your speed (in mph): ");
    speed = stdIn.nextDouble();
    System.out.print ("Enter your tailgate distance (in feet): ");
    tailgateDistance = stdIn.nextDouble();
    stoppingDistance=speed*(2.25+speed/21);
    if (stoppingDistance < tailgateDistance)
    System.out.println("No problem.");
    else if (stoppingDistance == tailgateDistance)
    System.out.println("Minor wreck.");
    else if (stoppingDistance > tailgateDistance)
    System.out.println("Major wreck!");
    } // end main
    } // end class StoppingA
    Edited by: Ensanvoration on Feb 23, 2010 3:31 PM

    Encephalopathic wrote:
    Ensanvoration wrote:
    Thanks, but I already tried that exact thing and it didn't work either. It's ridiculousIf you don't show us how you tried it, then we can only guess why it's not working.
    ... but if you wait around long enough, I bet you'll see JosAH post a recursive solution! :)Where is JosAH. Is he on vacation? Since I've been back, I haven't seen him.
    Well, let's raise a bottle of Grolsch to him anyway. More for us.
    ¦ {Þ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • I need help with setting up my Sun Java Studio Creator

    Hello all, i need help with setting up the Studio Creator, i"m new to all that staff so is there anyone to help me just a little with all that if yes email me at [email protected] or get me on AOL Instant Messanger with the screen name: wretch17
    thanks :-)

    Hi,
    Welcome to the Creator community! Thanks for your interst in Sun Java Studio Creator. Please feel free to post any question related to creator on this forum .
    Take a look the creator website at
    http://developers.sun.com/prodtech/javatools/jscreator/
    CreatorTeam

  • Help with Login Form (JSP DB Java Beans Session Tracking)

    Hi, I need some help with my login form.
    The design of my authetication system is as follows.
    1. Login.jsp sends login details to validation.jsp.
    2. Validation.jsp queries a DB against the parameters received.
    3. If the query result is good, I retrieve some information (login id, name, etc.) from the DB and store it into a Java Bean.
    4. The bean itself is referenced with the current session.
    5. Once all that's done, validation.jsp forwards to main.jsp.
    6. As a means to maintain state, I prefer to use url encoding instead of cookies for obvious reasons.I need some help from step 3 onwards please! Some code snippets will do as well!
    If you think this approach is not a good practice, pls let me know and advice on better practices!
    Thanks a lot!

    Alright,here is an example for you.
    Assume a case where you don't want to give access to any JSP View/HTML Page/Servlet/Backing Bean unless user logging system and let assume you are creating a View Object with the name.
    checkout an example (Assuming the filter is being applied to a pattern * which means when a resource is been accessed by webapplication using APP_URL the filter would be called)
    public doFilter(ServletRequest req,ServletResponse res,FilterChain chain){
         if(req instanceof HttpServletRequest){
                HttpServletRequest request = (HttpServletRequest) req;
                HttpSession session = request.getSession();
                String username = request.getParameter("username");
                String password = request.getParameter("password");
                String method = request.getMethod();
                String auth_type  = request.getAuthType();
                if(session.getAttribute("useInfoBean") != null)
                    request.getRequestDispatcher("/dashBoard").forward(req,res);
                else{
                        if(username != null && password != null && method.equaIsgnoreCase("POST") && (auth_type.equalsIgnoreCase("FORM_AUTH") ||  auth_type.equalsIgnoreCase("CLIENT_CERT_AUTH")) )
                             chain.doFilter(req,res);
                        else 
                          request.getRequestDispatcher("/Login.jsp").forward(req,res);
    }If carefully look at the code the autherization is given only if either user is already logged in or making an attempt to login in secured way.
    to know more insights about where these can used and how these can be used and how ?? the below links might help you.
    http://javaboutique.internet.com/tutorials/Servlet_Filters/
    http://e-docs.bea.com/wls/docs92/dvspisec/servlet.html
    http://livedocs.adobe.com/jrun/4/Programmers_Guide/filters3.htm
    http://www.javaworld.com/javaworld/jw-06-2001/jw-0622-filters.html
    http://www.servlets.com/soapbox/filters.html
    http://www.onjava.com/pub/a/onjava/2001/05/10/servlet_filters.html
    and coming back to DAO Pattern hope the below link might help you.
    http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html
    http://java.sun.com/blueprints/patterns/DAO.html
    http://www.javapractices.com/Topic66.cjp
    http://www.ibm.com/developerworks/java/library/j-dao/
    http://www.javaworld.com/javaworld/jw-03-2002/jw-0301-dao.html
    On the whole(:D) it is always a good practice to get back to Core Java/J2EE Patterns.and know answers to the question Why are they used & How do i implement them and where do i use it ??
    http://www.fluffycat.com/java-design-patterns/
    http://java.sun.com/blueprints/corej2eepatterns/Patterns/index.html
    http://www.cmcrossroads.com/bradapp/javapats.html
    Hope that might help :)
    REGARDS,
    RaHuL

  • Pls help, i m totally new to java

    Hi everyone, i m new to java, i have created a page with a textfield and two buttons, can someone tell me how to pass the text that i input in the text field into my database (mysql) when i click the add button (id:addButton) and then how to retrieve a data from a column of my database when i click the show button (id:showButton)?
    my table name is todolist3 and the column in my database is item.
    Thank you very much!!!

    if u are completly new to java, u must at least read some tutorials about java and later, the tutorial of Java Studio Creator, and if u have time, something about jsp.
    i dont want to be rude, but listen my advice, if u want to make your "example" to work, u need to copy the mysql conector into core, this is inside of creator, create a data source to bind your project to mysql table, and the best part, send and receive data from your mysql database.
    any doubt just post again
    Belthazor

  • Plz help me I'm new to java

    I've created simple data base in sql and a simple html page,here is the code:
    <%@ page import="java.util.*" import="java.sql.*" %>
    <%!
    private String emp_code, emp_name, emp_dept, emp_title, emp_doj, emp_dob;
    private String error, info, create;
    private short age;
    private Statement stmt;
    %>
    <%
    //load the JDBC driver
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn = DriverManager.getConnection("jdbc:odbc:Master","","");
    Statement s = conn.createStatement();
    s.executeUpdate("insert into employee_info values('" + emp_code + "', '" + emp_name + "','" + emp_dept + "','" + emp_title + "', '" + emp_doj + "','" + emp_dob + "') ");
    System.out.println ("It has been successfully added");
    %>
    <HTML>
    <HEAD>
         <TITLE> ---: New Employee Information :--- </TITLE>
    </HEAD>
    <BODY>
    <DIV ALIGN="center">
         <H2> New Employee Information </H2></DIV>
    <DIV ALIGN="center">
         <p> � </p></DIV>
         <FORM METHOD = "POST" ACTION = "NewEmp.jsp">
    <H4>Employee Code: <INPUT TYPE= "text" NAME = "first1" SIZE = "17">����
    Name: <INPUT TYPE = "TEXT" NAME = "first" SIZE = "51">�������
    <font size="3">Title:�<SELECT name="Grade">
    <OPTION SELECTED> - Select -
    <OPTION >Programmer
    <OPTION >Technetion
    <OPTION>System Analyst
    <OPTION>Network Administrator
    </SELECT>�</font>
              </H4>
    <H4><font size="3">�</font>
              </H4>
    <H4><font size="3">Department Code:�</font><select name="Dept">
    <OPTION SELECTED> - Select -
    <OPTION >IT
    <OPTION >Admin
    <OPTION>MGM
    <OPTION>CSD
    <OPTION>SM
    <OPTION>FIN
    </SELECT>
    ��������
    <font size="3"><b>DOB: </b> </font> <INPUT TYPE = "TEXT" NAME = "first2" SIZE = "18">������
    <b><font size="3">DOJ: </font></b><INPUT TYPE = "TEXT" NAME = "first3" SIZE = "18">
              </H4>
    <p>�
              </p>
    <P align="center">
    <INPUT TYPE = "SUBMIT" VALUE = "Submit">     
    <INPUT TYPE = "RESET">
    <input type="button" value="Cancel" name="Cancel" onClick='javascript:window.close();'> </FORM>
    <p align="center">�</p>
    </BODY>
    </HTML>
    But I couldn't complete it or make the connection to the database, I want to fill in the blanks and then add it to the data base.
    My database name is doctrak and the table name is employee_info and below the design of the table :
    emp_code     char     10
    emp_name char     30     
    emp_dept     char     15     
    emp_title     char     10     
    emp_doj     datetime     8     
    emp_dob     datetime     8     
    I've installed the apatchi tomcat 401 and make the java environment.
    So plz can any one help me in that?
    Thanks

    But I don't know how to handel the code, I didn't
    study JSP or Java. I'm trying to learn it by doing
    this, so please can you write the code for me in jsp
    and how to put it in html then , how to do the
    connection to my database?Iam sorry to disappoint you, but no.
    If you are new to java and jsp taking up such a task to learn it is not ideal, nor
    viable. I would suggest you learn the basics of the language first, then the basics
    of jsp, then some jdbc and finally graduate to the example in question. There are
    excellent tutorials avbl for all on the net.
    Maybe someone else would even post the code here, but suggest you dont
    waste time waiting on it.
    All the best.
    Cheers,
    ram.

  • Help with this problem please GasPump.java

    I've been working on this program for a week now and i have not gotten it to complie yet. Could anybody help me out? Your help would be greatly appreciated. Thanks.
    public class GasPump {
          double pricePerGallon;
          double gallons;
          int fuelType;
          int paymentType;
          float washPrice;
          String fuelName;
           public GasPump ( )  
             { pricePerGallon = 2.699; }
           public GasPump ( double price)  
             { pricePerGallon = price; }        
           public void setCost(double cost)   
             { double pricePerGallon  = cost; }
           double  getCost( )
             { return pricePerGallon; }
           public setGrade(int fuelType)
             { String fuelName;
            switch (fuelType)
                   case 1:    fuelName = ?Regular Unleaded?
                                  break;
                   case 2:    fuelName = ?Mid grade Unleaded?
                                  break;
                   case 3:    fuelName = ?Super Unleaded?
                                  break;
                   case 4:    fuelName = ?Diesel?
                                  break;
                   case 5:    fuelName = ?Natural Gas?
                                  break;
                   default:   System.out.println(?Unknown fuel type? + fuelType);
                               fuelName = ?Unknown?;
                   public String getGrade ( )
                   { return fuelName; }
                   double calcBill (double gallons)
                   { return(pricePerGallon * gallons); }
                   void paymentMethod(int  paymentType)    
                    if (paymentType  == 1)
                   payInsideMethod();
                    else
                          if (paymentType == 2)
                    payOutsideMethod();
                          else
                        if (paymentType == 3)
                       payInsideMethod ( );   
                          else
                     System.out.println(?Unknown payment type?);
                void payInsideMethod( )
                     System.out.println(?Pay cashier inside the gas station?);
                void payOutsideMethod( )
                System.out.println(?Please pay with your credit card ?);
               float   carWash (int washType)
                 washPrice = 0.00f;       
                  if (washType == 1)
                    washPrice = 7.00f;   
                      else
                  if (washType == 2)
                             washPrice = 8.00f; 
                  else
                            System.out.println(?Unknown wash type?);
                      return  (float)washPrice;   
                       void printReceipt ( )  
                        /*     System.out.println(fuelName + ? ? +gallons + ? Gallons purchased at $ ? + 
                               pricePerGallon + ? per gallon ? + ? Total cost is:  ? + 
                               pricePerGallon * gallons + ? Total bill is $ :" +
                               ((pricePerGallon * gallons) + washPrice)); */
                           System.out.printf("%s %.2f Gallons purchased at $%.2f per gallon.\nTotal
                  cost is: %.2f",
                                               fuelName, gallons, pricePerGallon, pricePerGallon *
                  gallons);
                       System.out.printf(" Total bill is $: %.2f", ((pricePerGallon * gallon) +
               washPrice));
               }

    sorry my compile errors read
    GasPump.java:31: illegal character: \8220
             case 3:    fuelName = ?Super Unleaded?;
                                   ^
    GasPump.java:31: illegal character: \8221
             case 3:    fuelName = ?Super Unleaded?;
                                                  ^
    GasPump.java:33: illegal character: \8220
             case 4:    fuelName = ?Diesel?;
                                   ^
    GasPump.java:33: illegal character: \8221
             case 4:    fuelName = ?Diesel?;
                                          ^
    GasPump.java:35: illegal character: \8220
             case 5:    fuelName = ?Natural Gas?;
                                   ^
    GasPump.java:35: illegal character: \8221
             case 5:    fuelName = ?Natural Gas?;
                                               ^
    GasPump.java:37: illegal character: \8220
            default:   System.out.println(?Unknown fuel type? + fuelType);
                                          ^
    GasPump.java:37: illegal character: \8221
            default:   System.out.println(?Unknown fuel type? + fuelType);
                                                            ^
    GasPump.java:37: ')' expected
            default:   System.out.println(?Unknown fuel type? + fuelType);
                                                                         ^
    GasPump.java:38: illegal character: \8220
                               fuelName = ?Unknown?;
                                          ^
    GasPump.java:38: illegal character: \8221
                               fuelName = ?Unknown?;
                                                  ^
    GasPump.java:59: illegal character: \8220
                              System.out.println(?Unknown payment type?);
                                                 ^
    GasPump.java:59: illegal character: \8221
                              System.out.println(?Unknown payment type?);
                                                                      ^
    GasPump.java:59: ')' expected
                              System.out.println(?Unknown payment type?);
                                                                        ^
    GasPump.java:64: illegal character: \8220
                      System.out.println(?Pay cashier inside the gas station?);
                                         ^
    GasPump.java:64: illegal character: \8221
                      System.out.println(?Pay cashier inside the gas station?);
                                                                            ^
    GasPump.java:64: ')' expected
                      System.out.println(?Pay cashier inside the gas station?);
                                                                              ^
    GasPump.java:69: illegal character: \8220
                      System.out.println(?Pay at the pump with credit card ?);
                                         ^
    GasPump.java:69: illegal character: \8221
                      System.out.println(?Pay at the pump with credit card ?);
                                                                           ^
    GasPump.java:69: ')' expected
                      System.out.println(?Pay at the pump with credit card ?);
                                                                             ^
    GasPump.java:82: illegal character: \8220
                             System.out.println(?Unknown wash type?);
                                                ^
    GasPump.java:82: illegal character: \8221
                             System.out.println(?Unknown wash type?);
                                                                  ^
    GasPump.java:82: ')' expected
                             System.out.println(?Unknown wash type?);
                                                                    ^
    GasPump.java:94: unclosed string literal
                           System.out.printf("%s %.2f Gallons purchased at $%.2f per
    gallon.\nTotal
                                             ^
    GasPump.java:95: unclosed string literal
                   cost is: %.2f",
                                ^
    GasPump.java:97: ')' expected
                     gallons);
                             ^
    26 errorsBasically wherever I have a quotation mark or a semi-colon there is a error there. I just started programming so im still trying to get the hang of it

  • Need help with adding arrays to invoice.java please willing to pay?

    Using your Invoice class created in lab02, write a client program that allows the user to input three Invoice objects into an array of Invoice objects. After you have inputted all of the invoices, print a heading and then output all of the array elements (Invoice objects) by calling the method from your Invoice class that displays all of the data members on a single line using uniform field widths to insure that all Invoice objects will line up in column format (created in Lab04). At the end of the loop, display the calculated total retail value of all products entered in the proper currency format.
    Example of possible program execution:
    Part Number : WIDGET
    Part Description : A fictitious product
    Quantity : 100
    Price          : 19.95
    (etc.)
    Example of possible output
    Part Number          Part Description          Quantity          Price     Amount
    WIDGET          A fictitious product     100          19.95     199.95
    Hammer               9 pounds          10          5.00     50.00
    (etc.)
    Total Retail Value:                                   249.95
    This is what i have so far Invoice Test
    //Lab 2 InvoiceTest.java
    //Application to test class Invoice.
    //By Morris Folkes
    public class InvoiceTest
    public static void main( String args[] )
    Invoice invoice1 = new Invoice( "1234", "Hammer", 2, 14.95 );
    // display invoice1
    System.out.println( "Original invoice information" );
    System.out.printf( "Part number: %s\n", invoice1.getPartNumber() );
    System.out.printf( "Description: %s\n",
    invoice1.getPartDescription() );
    System.out.printf( "Quantity: %d\n", invoice1.getQuantity() );
    System.out.printf( "Price: %.2f\n", invoice1.getPricePerItem() );
    System.out.printf( "Invoice amount: %.2f\n",
    invoice1.getInvoiceAmount() );
    // change invoice1's data
    invoice1.setPartNumber( "001234" );
    invoice1.setPartDescription( "Blue Hammer" );
    invoice1.setQuantity( 3 );
    invoice1.setPricePerItem( 19.49 );
    // display invoice1 with new data
    System.out.println( "\nUpdated invoice information" );
    System.out.printf( "Part number: %s\n", invoice1.getPartNumber() );
    System.out.printf( "Description: %s\n",
    invoice1.getPartDescription() );
    System.out.printf( "Quantity: %d\n", invoice1.getQuantity() );
    System.out.printf( "Price: %.2f\n", invoice1.getPricePerItem() );
    System.out.printf( "Invoice amount: %.2f\n",
    invoice1.getInvoiceAmount() );
    Invoice invoice2 = new Invoice( "5678", "PaintBrush", -5, -9.99 );
    // display invoice2
    System.out.println( "\nOriginal invoice information" );
    System.out.printf( "Part number: %s\n", invoice2.getPartNumber() );
    System.out.printf( "Description: %s\n",
    invoice2.getPartDescription() );
    System.out.printf( "Quantity: %d\n", invoice2.getQuantity() );
    System.out.printf( "Price: %.2f\n", invoice2.getPricePerItem() );
    System.out.printf( "Invoice amount: %.2f\n",
    invoice2.getInvoiceAmount() );
    // change invoice2's data
    invoice2.setQuantity( 3 );
    invoice2.setPricePerItem( 9.49 );
    // display invoice2 with new data
    System.out.println( "\nUpdated invoice information" );
    System.out.printf( "Part number: %s\n", invoice2.getPartNumber() );
    System.out.printf( "Description: %s\n",
    invoice2.getPartDescription() );
    System.out.printf( "Quantity: %d\n", invoice2.getQuantity() );
    System.out.printf( "Price: %.2f\n", invoice2.getPricePerItem() );
    System.out.printf( "Invoice amount: %.2f\n",
    invoice2.getInvoiceAmount() );
    } // end main
    } // end class InvoiceTest

    i suck in java There are 2 possible reasons for this:
    1. you haven't studied
    2. you aren't cut out for programming
    and there r hardly any tutors at my school. plus i work 2 jobs day n night. Please, I'm only want help thats allYou have the help of the ENTIRE WORLD COMMUNITY right here, right now. But you're not willing to make any effort whatsoever. You think people will help or even respect you? You may fail your class and you may fail in life!
    Cheaters don't win and winners don't cheat!

  • Help with creating a new window

    Hi there
    Could anyone help me with the coding to create a new window in java? Basically its when i click on a button a new window pops up
    thanks

    Icer_age828 wrote:
    Could anyone help me with the coding to create a new window in java? Basically its when i click on a button a new window pops upWe need more information on what you mean here, what you know and what you don't know. Do you understand the basics of Java? Are you talking about using Swing? If so, what exactly do you mean by a "new window"? You can create a simple dialog via the method JOptionPane.showMessage(...) method. Do you mean to create and show a new JDialog? JFrame? Do you know about ActionListeners and how to add them to jbuttons? Given your post, I think that your best bet would be to start going through the Sun Java Swing tutorial from the beginning. Look here .

  • Help with iTunes on new PC

    Hello, I am having great problems with iTunes and would appreciate any help. This is what happened,
    1) I had a virus on my laptop so I backed up only music, photos and videos onto HDD
    2) The way I backed up iTunes library was by moving the whole iTunes library folder onto the HDD
    3) I formatted the laptop
    4) I moved the iTunes folder back into the virus free laptop
    5) Installed iTunes and all the music, podcast, audiobooks are there with my ratings, play counts etc.
    ..but..
    6) There is a next to every song, which will require me to go through the whole 3000 songs locating them.
    So my question is...is there a way of batch locating them?
    Or is there any other way?
    HP Pavilion   Windows XP Pro  
    HP Pavilion   Windows XP Pro  

    It sounds as though you are on the right track whith what you did.
    Can you confirm that you copied the following folder onto the external HDD:
    ...My Documents\My Music\iTunes
    And also that this folder contained all your music etc.
    When you've done that we can decide exactly what to do, in the meantime here is some genreal inforamtion
    What you should have done is installed iTunes first, then with iTunes closed, you drag the iTunes folder, which will be pretty empty at this stage, out onto your desktop. Then you copy the iTunes folder from the external HDD into My Music to replace the orginal.
    The process is explained in this apple link although it uses an iPod to transfer the iTunes folder rather than an external HDD.
    http://docs.info.apple.com/article.html?artnum=300173
    This process breaks down if some of your stuff was not in the iTunes folder. This is becuase iTunes stores the full path to your music files. The full path will be something like:
    c:\Documents and Settings\username\My Documents\My Music\iTunes
    Your username is part of the path and if your account name on the new PC is not identical with the old one, things go wrong. iTunes is clever enough to find things in the iTunes folder, but stuff outside, say in My Music, will not be found.

  • Help with Error on tomcat and java servlet

    i've just recently installed Dialect Payment client onto my server and is using Java to correspond with the server. I can run the diagnostic test run perfectly fine but when I have compiled the form and the app, I keep getting the error:
    javax.servlet.ServletException: Invoker service() exception
         org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:478)
         org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java:170)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         filters.ExampleFilter.doFilter(ExampleFilter.java:149)
    root cause
    com.qsipayments.utility.AssertionError: InvalidConfigException can only be thrown on reload
         com.qsipayments.utility.Assert.shouldNotReachHere(Assert.java:246)
         PaymentClient.util.PCConfigurationService.getConfiguration(PCConfigurationService.java:72)
         com.qsipayments.utility.logging.Logging.initialise(Logging.java:198)
         PaymentClient.PaymentClientBase.initialiseLogging(PaymentClientBase.java:1179)
         PaymentClient.PaymentClientBase.<init>(PaymentClientBase.java:106)
         PaymentClient.PaymentClientImpl.<init>(PaymentClientImpl.java:26)
         Java_3DS_3P_AuthPay_DO.doPost(Java_3DS_3P_AuthPay_DO.java:116)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:420)
         org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java:170)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         filters.ExampleFilter.doFilter(ExampleFilter.java:149)
    If anyone can help or advise me on this matter, it would be incredibly fantastic! I've tried asking the people who have provided me with the program but they dont seem to have anything useful that i can do to fix the error. I was told by my server admin that it was in the coding, but they claim that it has nothing to do with the coding.
    PLEASE HELP.I've been working on this for months and about to die from frustration!

    I haven't worked with this vendor product, but here are some ideas you might find useful:
    It appears is a configuration problem when using the vendor software (but they already told you that, didn't they!!!).
    I say the above because these lines in your printout are from vendor supplied objects (that you didn't create):
    com.qsipayments.utility.AssertionError: InvalidConfigException can only be thrown on reload
    com.qsipayments.utility.Assert.shouldNotReachHere(Assert.java:246)
    PaymentClient.util.PCConfigurationService.getConfiguration(PCConfigurationService.java:72)
    I suggest creating a brand new project with the simplist use of the above vendor project and get it to work.
    You can use the vendor's (on line) documentation to do this. Deploy it in production to ensure there are no deployment issues. Work closely with one of
    your fellow employees (more than one pair of eyes can pick up stuff that you miss). Next, look at what features of the vendor software the originial project uses and what features the sample project uses. Try to implement a subset of functionality of the orginial project into the sample project and get that to work. Implement the next feature, test, etc. Do small experiments at a time so you can easily isolate what doesnt work.
    If none of the above works for you, try contacting the manufacturer or thier support web site. If none of the above works, look into using a compeditors product.

  • Help with start up. new iMac 27" with Marericks installed has been giving me trouble with IDs and passwords.  More than one account downloaded from older Laptop.  Now the computer has the turning wheel in from of gray screen and won't go any further when

    I recently started using my desktop iMac 27" and have been having problems since installing Mavericks, not saying that Mavericks is the problem per se.  I think I have too many accounts with too many names, with too many Apple IDs and too many passwords, email passwords and Apple ID passwords, and keychain passwords, etc.  Can't keep them straight even though I write everything down.  The screen has been making me log in and log out with Account name and passwords after everything I've been doing, also confused about Users and Groups and how to sync everything. I finally just "shut down" everything and the screen was black.  When I turned the computer on again, the circular gear in the middle just kept turning but nothing happened after that.  Then I held the on button in the back until the screen went black again. 
    What should I do?  Is there a way to combine all my accounts into one account with one Apple ID?  I should say that I also have trying to use iCloud and it has different IDs and passwords. Also when I try to log in with one account name, I can't enter anything I write,and when I type on the keyboard, nothing appears on the screen, although I can receive emails, I can't send them. 
    In another account, what I type does appear on the screen, but I think it's an earlier account and doesn't translate aver to the other account. ALTHOUGH i set up iCloud accounts, they don't appear any more.
    Very confused.  Any Ideas about how I can get the computer to start up again and show a new screen?
    Thanks to anyone who has workable suggestions.

    If you really believe that your system has been compromised, here's what you do:
    Disconnect your Mac from your cable modem;
    Back up any documents on your system that are important to you;
    Boot your Mac from the system installation disks that came with it (insert the disk, restart your Mac, and hold down the "c" key until you get the "spinning gear" icon);
    Choose a language and click the arrow button to continue;
    From the Utilities menu, choose Disk Utility;
    In Disk Utility, select your computer's hard drive;
    Click the "Erase" tab;
    Click the "Security Options" button and select to have it overwrite all the data on the hard drive;
    Click the "Erase" button and allow it to process;
    Once the "erase process has completed (it will take a while), reinstall Mac OS X.
    Or, if this is too much for you to accomplish on your own, take your system to an Apple Store and have them help you perform these steps. If your system was indeed compromised, this will remove any such hack. You can then set up a new user account for the computer, reinstall your applications (reinstall only from original disks or downloads from the company making the software) and documents, and reconnect to the Internet.
    Note that when you reconnect to the cable modem, you may still get an IP address starting with 198. This is normal with some cable modems and probably not a cause for concern. It will not be an indication that your system is still compromised; that will not be possible if you perform all the above steps.
    Regards.

  • Help with my Bran-New Creative Zen Micro Photo. [Questi

    <EM>If you don't want to see the backing of my whole story skip to the bold print at the bottom!</EM>I also want you to know I read the FAQs and searched through some topics like this, but haven't found any asking my question.First of all, I'm new to the forum, but I've been researching Creative's Zen for a long time now. I kept observing each one closely before I purchased a product. I then saw the Zen Micro Photo come out. This one won my attention. I loved this, I quickly searched for reviews and went for the buy for Christmas. I told my dad about it and he was "iffy" on the price, but it was better then the iPod in my opinion.Christmas day came and I opened it. Right away I checked everything out I knew a lot about the menu already and all, but not really how to control it. I checked to make sure everything worked. All systems were go. After listening to the defaults (which I loved) I went to go install the software. I already had Media Player 0 and Adobe, oh and I didn't want the freakin AOL toolbar! Lol, so I installed everything else. It took forever, but I hooked it up and I installed the drivers, but as soon as I plug in the USB connector I see: "A HIGH-SPEED USB device has been plugged into a LOW SPEED USB port.After that, I switched USB ports, btu I got same message. I hit the X and then tried to charge. I got the Lightening Bolt, but no dimming of lights. I found out that this computer is not letting me install any service packs, I'm confused about that.My question:Is there anyway I can charge this mp3 player and download music onto my Zen Micro Photo without Service Pack ? Or did I just pay $250 for a really cool glowing mp3 player to be used as a paperweight? (I love this Zen and I ran the battery dead hoping that would make the charging easier).Help?
    My Specifications:
    My Mp3 Player: Zen Micro Photo (Black)What I tried: Switching USB ports and re-installing Service Pack Software: Not sure how to determine firmware without installing something. I'm on a XP Professional and I'm using the Creative Media Source and Creative Media Toolbox

    Thank you DM for responding. I am expecting problems, but it still won't allow me to charge the Zen Micro Photo or even use the Creative Media Source. I can't upload any songs or any contacts on it. I haven't uploaded anything yet, but it's not reading the USB device. When I run Creative Zen Micro Photo Media Explorer I get this message at the top of the screen: "The device is not connected. Please connect your Zen MicroPhoto to the computer. I can't organize anything or add songs... so it just makes all the programs I downloaded useless and my Creative product unusuable.ONe thing it does do though... whenever I plug in my Zen MIcroPhoto to the USB it turns it on and glows, but only shows my battery at the top with one red line and the green lightening bolt filling the battery up.After leaving it like this for two hours the green moves, but the red bar stays the same size.

Maybe you are looking for

  • [svn:fx-trunk] 10229: Fixes for some transform effects problems.

    Revision: 10229 Author:   [email protected] Date:     2009-09-14 08:43:43 -0700 (Mon, 14 Sep 2009) Log Message: Fixes for some transform effects problems. - We were not animating the postLayout properties in some cases where we should have, effective

  • How to use EEWB

    Hi All, How to use EEWB. How to add new field in particular module in CRM. If you add the fields using EEBW will reflect those changes in Portal environment.  Thanks, Subbu.

  • Having problem with sudden shutdown on battery...

    Is there a way to test the battery? I can stay on the battery for about an hour and the "plug in warning" no longer appears, the screen just goes blank. Once I plug in and restart I haven't had the same issue yet. So I assume it's the battery. Could

  • Moving from one pc to another

    is there aeasy way of moving all playlists and downloaded records etc from a old pc to a new one without using CD or DVD writers etc

  • Adobe Acrobat 8 and IE7 - inability to print to PDF

    Anyone know why I can no longer use Print to Adobe PDF from a webpage using IE7?